## Incremental Cycle Detection, Topological Ordering, and Strong Component Maintenance (2008)

Citations: | 2 - 0 self |

### BibTeX

@MISC{Haeupler08incrementalcycle,

author = {Bernhard Haeupler and Telikepalli Kavitha and Rogers Mathew and Siddhartha Sen and Robert E. Tarjan},

title = {Incremental Cycle Detection, Topological Ordering, and Strong Component Maintenance},

year = {2008}

}

### OpenURL

### Abstract

We present two on-line algorithms for maintaining a topological order of a directed n-vertex acyclic graph as arcs are added, and detecting a cycle when one is created. Our first algorithm handles m arc additions in O(m 3/2) time. For sparse graphs (m/n = O(1)), this bound improves the best previous bound by a logarithmic factor, and is tight to within a constant factor among algorithms satisfying a natural locality property. Our second algorithm handles an arbitrary sequence of arc additions in O(n 5/2) time. For sufficiently dense graphs, this bound improves the best previous bound by a polynomial factor. Our bound may be far from tight; we conjecture that the algorithm actually runs in O(n² log n) time. A completely different algorithm running in Θ(n² log n) time was given recently by Bender, Fineman, and Gilbert. We extend both of our algorithms to the maintenance of strong components, without affecting the asymptotic time bounds.