annas.graph.util
Class Tarjan<N,A extends ArcInterface<N>>
java.lang.Object
annas.graph.util.Tarjan<N,A>
- Type Parameters:
N
- Node typeA
- Arc type
public class Tarjan<N,A extends ArcInterface<N>>
- extends java.lang.Object
Tarjan's Algorithm (named for its discoverer, Robert Tarjan) is a graph
theory algorithm for finding the strongly connected components of a graph. As
described in Tarjan, R.: Depth-first search and linear graph algorithms, SIAM
J. Com- put. 1, no. 2, pp. 146–160
- Author:
- Sam Wilson
Method Summary |
java.util.ArrayList<java.util.ArrayList<N>> |
execute()
executes Tarjan's algorithm of the suppled graph |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Tarjan
public Tarjan(GraphInterface<N,A> graph)
execute
public java.util.ArrayList<java.util.ArrayList<N>> execute()
- executes Tarjan's algorithm of the suppled graph
- Returns:
- A list of lists of node which belong to the same component