A dynamic topological sort algorithm for directed acyclic graphs

  • Authors:
  • David J. Pearce;Paul H. J. Kelly

  • Affiliations:
  • Victoria University of Wellington, Wellington, New Zealand;Imperial College London, United Kingdom

  • Venue:
  • Journal of Experimental Algorithmics (JEA)
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

We consider the problem of maintaining the topological order of a directed acyclic graph (DAG) in the presence of edge insertions and deletions. We present a new algorithm and, although this has inferior time complexity compared with the best previously known result, we find that its simplicity leads to better performance in practice. In addition, we provide an empirical comparison against the three main alternatives over a large number of random DAGs. The results show our algorithm is the best for sparse digraphs and only a constant factor slower than the best on dense digraphs.