incremental-cycle-detect (npm): Keeps a directed acyclic graph topologically sorted each time you add an edge or vertex to check for cycles.
Keywords: graph|graphs|directed|acyclic|dag|cycle|cyclic|cycle detection