English

An Improved Algorithm for Incremental Cycle Detection and Topological Ordering in Sparse Graphs

Data Structures and Algorithms 2018-10-09 v1

Abstract

We consider the problem of incremental cycle detection and topological ordering in a directed graph G=(V,E)G = (V, E) with V=n|V| = n nodes. In this setting, initially the edge-set EE of the graph is empty. Subsequently, at each time-step an edge gets inserted into GG. After every edge-insertion, we have to report if the current graph contains a cycle, and as long as the graph remains acyclic, we have to maintain a topological ordering of the node-set VV. Let mm be the total number of edges that get inserted into GG. We present a randomized algorithm for this problem with O~(m4/3)\tilde{O}(m^{4/3}) total expected update time.

Keywords

Cite

@article{arxiv.1810.03491,
  title  = {An Improved Algorithm for Incremental Cycle Detection and Topological Ordering in Sparse Graphs},
  author = {Sayan Bhattacharya and Janardhan Kulkarni},
  journal= {arXiv preprint arXiv:1810.03491},
  year   = {2018}
}
R2 v1 2026-06-23T04:32:12.662Z