A Dynamic Algorithm for Topologically Sorting Directed Acyclic Graphs

  • David J. Pearce
  • Paul H. J. Kelly
Conference paper

DOI: 10.1007/978-3-540-24838-5_29

Part of the Lecture Notes in Computer Science book series (LNCS, volume 3059)
Cite this paper as:
Pearce D.J., Kelly P.H.J. (2004) A Dynamic Algorithm for Topologically Sorting Directed Acyclic Graphs. In: Ribeiro C.C., Martins S.L. (eds) Experimental and Efficient Algorithms. WEA 2004. Lecture Notes in Computer Science, vol 3059. Springer, Berlin, Heidelberg

Abstract

We consider how to maintain 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 marginally 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 three alternatives over a large number of random DAG’s. The results show our algorithm is the best for sparse graphs and, surprisingly, that an alternative with poor theoretical complexity performs marginally better on dense graphs.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag Berlin Heidelberg 2004

Authors and Affiliations

  • David J. Pearce
    • 1
  • Paul H. J. Kelly
    • 1
  1. 1.Department of ComputingImperial CollegeLondonUK

Personalised recommendations