Class representing a node in a graph, labeled with an instance of class A.
Iterator on the nodes of the graph (in topological order if root is defined).
Iterator on the nodes of the graph (in arbitrary order).
Nodes of the graph.
Root node of the topological ordering of the graph
Computes the connected components of the graph using the recursive Tarjan algorithm.
Computes the connected components of the graph using the recursive Tarjan algorithm. The method returns a list of list of nodes representing the strongly connected components of the graph. If each scc has only one node in it, then the graph is acyclic.
Prints a dot representation of the graph using printing functions for nodes and edges provided as arguments
Recursive DFS topological sorting algorithm.
Recursive DFS topological sorting algorithm.
In this order, a node comes after all its predecessors.
The graph must be acyclic otherwise the algorithm will compute a wrong ordering.
After sucessfull execution, the nodes of the graph can be traversed in topological order using the inOrder method.
Class representing a dependency graph.