A topological order of the vertices of a directed acyclic graph G = (V,E) is any total order ord such that if (x, y) is an element of E, then x precedes y in ord. In this paper we consider the dynamic version of this problem, and provide simple algorithms and data structures achieving O(n) amortized time per edge insertion starting from an empty graph, which favorably compares to the trivial O(m+n) time bound per operation obtained applying the off-line algorithm. The additional space requirement, beside the representation of the graph itself, is O(n). Experimental results show that our algorithm performs in practice orders of magnitude faster than the off-line algorithm.
Maintaining a topological order under edge insertions / Alberto Marchetti, Spaccamela; Nanni, Umberto; Hans, Rohnert. - In: INFORMATION PROCESSING LETTERS. - ISSN 0020-0190. - STAMPA. - 59:1(1996), pp. 53-58. [10.1016/0020-0190(96)00075-0]
Maintaining a topological order under edge insertions
Alberto Marchetti Spaccamela;NANNI, Umberto;
1996
Abstract
A topological order of the vertices of a directed acyclic graph G = (V,E) is any total order ord such that if (x, y) is an element of E, then x precedes y in ord. In this paper we consider the dynamic version of this problem, and provide simple algorithms and data structures achieving O(n) amortized time per edge insertion starting from an empty graph, which favorably compares to the trivial O(m+n) time bound per operation obtained applying the off-line algorithm. The additional space requirement, beside the representation of the graph itself, is O(n). Experimental results show that our algorithm performs in practice orders of magnitude faster than the off-line algorithm.I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.