Depth-first discovery algorithm for incremental topological sorting of directed acyclic graphs

  • Authors:
  • Jianjun Zhou;Martin Müller

  • Affiliations:
  • Department of Computing Science, University of Alberta, Edmonton T6G 2E8, Canada;Department of Computing Science, University of Alberta, Edmonton T6G 2E8, Canada

  • Venue:
  • Information Processing Letters
  • Year:
  • 2003

Quantified Score

Hi-index 0.89

Visualization

Abstract

We study the problem of incrementally maintaining a topological sorting in a large DAG. The Discovery Algorithm (DA) of Alpern et al. [Proc. 1st Annual ACM-SIAM Symp. on Discrete Algorithms, 1990, pp. 32-42] computes a cover K of nodes such that a solution to the modified problem can be found by changing node priorities within K only. It achieves a runtime complexity that is polynomially bounded in terms of the minimal cover size k.The temporary space complexity of DA grows quickly with increasing number of added edges and cover size. We introduce the Depth-First Discovery Algorithm (DFDA), which uses depth-first search to reduce the temporary space of DA from O(|A| × ||-K||) to O(|A| + ||K||), where |A| is the number of edges to add and ||K|| is the extended size of the cover. DFDA is simpler than DA and performs better in our empirical tests.