package libsail
Module Jib_compile.IdGraphSource
include Graph.S with type node = Ast.id and type node_set = Ast_compare.IdSet.t
Add an edge from the first node to the second node, creating the nodes if they do not exist.
Return the set of nodes that are reachable from the first set of nodes (roots), without passing through the second set of nodes (cuts).
Topologically sort a graph. Throws Not_a_DAG if the graph is not directed acyclic.
Find strongly connected components using Tarjan's algorithm. This algorithm also returns a topological sorting of the graph components.
Note that this is at least O(n^3) where n is the number of nodes and very inefficiently constructs the result graph!