A fully dynamic reachability algorithm for directed graphs with an almost linear update time

Liam Roditty*, Uri Zwick

*Corresponding author for this work

Research output: Contribution to journalConference articlepeer-review

66 Scopus citations


We obtain a new fully dynamic algorithm for the reachability problem in directed graphs. Our algorithm has an amortized update time of O(m+n log n) and a worst-case query time of O(n), where m is the current number of edges in the graph, and n is the number of vertices in the graph. Each update operation either inserts a set of edges that touch the same vertex, or deletes an arbitrary set of edges. The algorithm is deterministic and uses fairly simple data structures. This is the first algorithm that breaks the O(n2) update barrier for all graphs with o(n2) edges. One of the ingredients used by this new algorithm may be interesting in its own right. It is a new dynamic algorithm for strong connectivity in directed graphs with an interesting persistency property. Each insert operation creates a new version of the graph. A delete operation deletes edges from all versions. Strong connectivity queries can be made on each version of the graph. The algorithm handles each update in O(mα(m, n)) amortized time, and each query in O(1) time, where α(m, n) is a functional inverse of Ackermann's function appearing in the analysis of the union-find data structure. Note that the update time of O(mα(m, n)), in case of a delete operation, is the time needed for updating all versions of the graph.

Original languageEnglish
Pages (from-to)184-191
Number of pages8
JournalConference Proceedings of the Annual ACM Symposium on Theory of Computing
StatePublished - 2004
EventProceedings of the 36th Annual ACM Symposium on Theory of Computing - Chicago, IL, United States
Duration: 13 Jun 200415 Jun 2004


  • Directed graphs
  • Dynamic graphs algorithms
  • Reachability
  • Transitive closure


Dive into the research topics of 'A fully dynamic reachability algorithm for directed graphs with an almost linear update time'. Together they form a unique fingerprint.

Cite this