Abstract
We consider the problem of detecting a cycle in a directed graph that grows by arc insertions and the related problems of maintaining a topological order and the strong components of such a graph. For these problems, we give two algorithms, one suited to sparse graphs, the other to dense graphs. The former takes O(min {m1/2, n2/3}m) time to insert m arcs into an n-vertex graph; the latter takes O(n2log n) time. Our sparse algorithm is substantially simpler than a previous O(m3/2)-time algorithm; it is also faster on graphs of sufficient density. The time bound of our dense algorithm beats the previously best time bound of O(n5/2) for dense graphs. Our algorithms rely for their efficiency on vertex numberings weakly consistent with topological order: we allow ties. Bounds on the size of the numbers give bounds on running time.
- Deepak Ajwani and Tobias Friedrich. 2007. Average-case analysis of online topological ordering. In ISAAC (Lecture Notes in Computer Science), Takeshi Tokuyama (Ed.), Vol. 4835. Springer, 464--475. Google ScholarDigital Library
- Deepak Ajwani, Tobias Friedrich, and Ulrich Meyer. 2006. An O(n2.75) algorithm for online topological ordering. In Proceedings of the 10th Scandinavian Workshop on Algorithm Theory (Lecture Notes in Computer Science), Vol. 4059. Springer, 53--64. Google ScholarDigital Library
- Deepak Ajwani, Tobias Friedrich, and Ulrich Meyer. 2008. An O(n2.75) algorithm for online topological ordering. ACM Transactions on Algorithms 4, 4, Article 39 (Aug. 2008), 39:1--39:14 pages. Google ScholarDigital Library
- Bowen Alpern, Roger Hoover, Barry K. Rosen, Peter F. Sweeney, and F. Kenneth Zadeck. 1990. Incremental evaluation of computational circuits. In Proceedings of the 1st Annual ACM-SIAM Symposium on Discrete Algorithms. 32--42. Google ScholarDigital Library
- Michael A. Bender, Richard Cole, Erik D. Demaine, Martin Farach-Colton, and Jack Zito. 2002. Two simplified algorithms for maintaining order in a list. In Proceedings of the European Symposium on Algorithms. 152--164. Google ScholarDigital Library
- Michael A. Bender, Jeremy T. Fineman, and Seth Gilbert. 2009. A new approach to incremental topological ordering. In Proceedings of the ACM-SIAM Symposium on Discrete Algorithms. Google ScholarDigital Library
- Boris V. Cherkassky, Andrew V. Goldberg, and Craig Silverstein. 1997. Buckets, heaps, lists, and monotone priority queues. In Proceedings of the 8th Annual ACM-SIAM Symposium on Discrete Algorithms. Society for Industrial and Applied Mathematics, Philadelphia, PA, 83--92. Google ScholarDigital Library
- Eric V. Denardo and Bennett L. Fox. 1979. Shortest-route methods: 1. Reaching, pruning, and buckets. Operations Research 27 (1979), 161--186. Google ScholarDigital Library
- Paul F. Dietz and Daniel D. Sleator. 1987. Two algorithms for maintaining order in a list. In Proceedings of the ACM Symposium on the Theory of Computing. 365--372. Google ScholarDigital Library
- Bernhard Haeupler, Telikepalli Kavitha, Rogers Mathew, Siddhartha Sen, and Robert E. Tarjan. 2008. Faster algorithms for incremental topological ordering. In Proceedings of the 35th International Colloquium on Automata, Languages, and Programming. 421--433. Google ScholarDigital Library
- Bernhard Haeupler, Telikepalli Kavitha, Roger Mathew, Siddhartha Sen, and Robert E. Tarjan. 2012. Incremental cycle detection, topological ordering, and strong component maintenance. ACM Transactions on Algorithms 8, 1, Article 3 (Jan. 2012), 3:1--3:33 pages. Google ScholarDigital Library
- Frank Harary, Robert Z. Norman, and Dorwin Cartwright. 1965. Structural Models: An Introduction to the Theory of Directed Graphs. John Wiley & Sons.Google Scholar
- A. B. Kahn. 1962. Topological sorting of large networks. Communications of the ACM 5, 11 (Nov. 1962), 558--562. Google ScholarDigital Library
- Irit Katriel. 2004. On Algorithms for Online Topological Ordering and Sorting. Technical Report MPI-I-2004-003. Max-Planck-Institut für Informatik, Saarbrücken, Germany.Google Scholar
- Irit Katriel and Hans L. Bodlaender. 2005. Online topological ordering. In Proceedings of the 16th ACM-SIAM Symposium on Discrete Algorithms. Vancouver, British Columbia, Canada, 443--450. Google ScholarDigital Library
- Irit Katriel and Hans L. Bodlaender. 2006. Online topological ordering. ACM Transactions on Algorithms 2, 3 (July 2006), 364--379. Google ScholarDigital Library
- Donald E. Knuth. 1973. The Art of Computer Programming, Volume 1: Fundamental Algorithms (2nd ed.). Addison Wesley, Reading, MA.Google Scholar
- Donald E. Knuth. 1998. The Art of Computer Programming, Volume 3: Sorting and Searching (2nd ed.). Addison Wesley Longman Publishing Co., Redwood City, CA, USA. Google ScholarDigital Library
- Donald E. Knuth and Jayme L. Szwarcfiter. 1974. A structured program to generate all topological sorting arrangements. Information Processing Letters 2, 6 (1974), 153--157.Google ScholarCross Ref
- Hsiao-Fei Liu and Kun-Mao Chao. 2007. A tight analysis of the Katriel--Bodlaender algorithm for online topological ordering. Theoretical Computer Science 389, 1--2 (2007), 182--189. DOI:http://dx.doi.org/10.1016/j.tcs.2007.08.009 Google ScholarDigital Library
- Alberto Marchetti-Spaccamela, Umberto Nanni, and Hans Rohnert. 1996. Maintaining a topological order under edge insertions. Information Processing Letters 59, 1 (1996), 53--58. DOI:http://dx.doi.org/10.1016/0020-0190(96)00075-0 Google ScholarDigital Library
- David J. Pearce, Paul H. J. Kelly, and Chris Hankin. 2003. Online cycle detection and difference propagation for pointer analysis. In Proceedings of the 3rd International Workshop on Source Code Analysis and Manipulation. 3--12.Google ScholarCross Ref
- David J. Pearce. 2005. Some Directed Graph Problems and Their Application to Pointer Analysis. Ph.D. Dissertation. University of London.Google Scholar
- David J. Pearce and Paul H. J. Kelly. 2003. Online Algorithms for Topological Order and Strongly Connected Components. Technical Report. Imperial College, London.Google Scholar
- David J. Pearce and Paul H. J. Kelly. 2004. A dynamic algorithm for topologically sorting directed acyclic graphs. In Proceedings of the 3rd International Workshop on Efficient Experimental Algorithms (Lecture Notes in Computer Science), Vol. 3059. Springer, 383--398.Google Scholar
- David J. Pearce and Paul H. J. Kelly. 2006. A dynamic topological sort algorithm for directed acyclic graphs. Journal of Experimental Algorithms 11, Article 1.7 (Feb. 2006). Google ScholarDigital Library
- David J. Pearce and Paul H. J. Kelly. 2010. A batch algorithm for maintaining a topological order. In Proceedings of the 33rd Australasian Conference on Computer Science (ACSC’10). 79--88. Google ScholarDigital Library
- Liam Roditty and Uri Zwick. 2008. Improved dynamic reachability algorithms for directed graphs. SIAM Journal on Computing 37, 5 (2008), 1455--1471. Google ScholarDigital Library
- Edward Szpilrajn. 1930. Sur l’Extension de l’Ordre Partiel. Fundamenta Mathematicae 16 (1930), 386--389.Google ScholarCross Ref
- Robert E. Tarjan. 1972. Depth-first search and linear graph algorithms. SIAM Journal on Computing 1, 2 (1972), 146--160.Google ScholarDigital Library
- Robert E. Tarjan. 1974. Finding dominators in directed graphs. SIAM Journal on Computing 3, 1 (1974), 62--89.Google ScholarCross Ref
- Robert E. Tarjan. 1975. Efficiency of a good but not linear set union algorithm. Journal of the Association for Computing Machinery 22, 2 (1975), 215--225. Google ScholarDigital Library
- Robert Endre Tarjan. 1983. Data Structures and Network Algorithms. Society for Industrial and Applied Mathematics, Philadelphia, PA. Google ScholarDigital Library
- Robert E. Tarjan and Jan van Leeuwen. 1984. Worst-case analysis of set union algorithms. Journal of the Association for Computing Machinery 31, 2 (March 1984), 245--281. DOI:http://dx.doi.org/10.1145/62.2160 Google ScholarDigital Library
- J. W. J. Williams. 1964. Algorithm 232: Heapsort. Communications of the ACM 7, 6 (1964), 347--348.Google ScholarDigital Library
Index Terms
- A New Approach to Incremental Cycle Detection and Related Problems
Recommendations
Incremental Cycle Detection, Topological Ordering, and Strong Component Maintenance
We present two online 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(m3/2) time. For sparse graphs (m/n = ...
Decremental strongly-connected components and single-source reachability in near-linear time
STOC 2019: Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of ComputingComputing the Strongly-Connected Components (SCCs) in a graph G=(V,E) is known to take only O(m+n) time using an algorithm by Tarjan from 1972[SICOMP 72] where m = |E|, n=|V|. For fully-dynamic graphs, conditional lower bounds provide evidence that the ...
Graph Pattern Detection: Hardness for all Induced Patterns and Faster Noninduced Cycles
We consider the pattern detection problem in graphs: given a constant size pattern graph $H$ and a host graph $G$, determine whether $G$ contains a subgraph isomorphic to $H$. We present the following new improved upper and lower bounds: We prove that if a ...
Comments