An O(n) algorithm for incremental topological ordering
نویسندگان
چکیده
We present a simple algorithm which maintains the topological order of a directed acyclic graph with n nodes under an online edge insertion sequence in O(n) time, independent of the number m of edges inserted. For dense DAGs, this is an improvement over the previous best result of O(min{m 3 2 logn, m 3 2 + n logn}) by Katriel and Bodlaender. We also provide an empirical comparison of our algorithm with other algorithms for incremental topological sorting.
منابع مشابه
Average-case analysis of incremental topological ordering
Many applications like pointer analysis and incremental compilation require maintaining a topological ordering of the nodes of a directed acyclic graph (DAG) under dynamic updates. All known algorithms for this problem are either only analyzed for worst-case insertion sequences or only evaluated experimentally on random DAGs. We present the first averagecase analysis of incremental topological ...
متن کاملA new approach to incremental topological ordering
Let G = (V,E) be a directed acyclic graph (dag) with n = |V | and m = |E|. We say that a total ordering ≺ on vertices V is a topological ordering if for every edge (u,v) ∈ E , we have u ≺ v. In this paper, we consider the problem of maintaining a topological ordering subject to dynamic changes to the underlying graph. That is, we begin with an empty graph G =(V, / 0) consisting of n nodes. The ...
متن کاملAverage-Case Analysis of Online Topological Ordering
Many applications like pointer analysis and incremental compilation require maintaining a topological ordering of the nodes of a directed acyclic graph (DAG) under dynamic updates. All known algorithms for this problem are either only analyzed for worst-case insertion sequences or only evaluated experimentally on random DAGs. We present the first average-case analysis of online topological orde...
متن کاملeb 2 00 8 Average - Case Analysis of Online Topological Ordering ∗
Many applications like pointer analysis and incremental compilation require maintaining a topological ordering of the nodes of a directed acyclic graph (DAG) under dynamic updates. All known algorithms for this problem are either only analyzed for worst-case insertion sequences or only evaluated experimentally on random DAGs. We present the first average-case analysis of online topological orde...
متن کاملFaster Algorithms for Online Topological Ordering
We present two algorithms for maintaining the topological order of a directed acyclic graph with n vertices, under an online edge insertion sequence of m edges. Efficient algorithms for online topological ordering have many applications, including online cycle detection, which is to discover the first edge that introduces a cycle under an arbitrary sequence of edge insertions in a directed grap...
متن کامل