Package net.jangaroo.jooc.util
Class GraphUtil
- java.lang.Object
-
- net.jangaroo.jooc.util.GraphUtil
-
public class GraphUtil extends Object
A utility for finding the strongly connected components of a graph, implementing Kosaraju's algorithm non-recursively.
-
-
Constructor Summary
Constructors Constructor Description GraphUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> List<T>findPath(Map<T,? extends Collection<T>> graph, T start, T end)Find the shortest path from start to end.static <T> Collection<Set<T>>stronglyConnectedComponent(Map<T,? extends Collection<T>> graph)
-
-
-
Method Detail
-
stronglyConnectedComponent
public static <T> Collection<Set<T>> stronglyConnectedComponent(Map<T,? extends Collection<T>> graph)
-
findPath
public static <T> List<T> findPath(Map<T,? extends Collection<T>> graph, T start, T end)
Find the shortest path from start to end.- Type Parameters:
T-- Parameters:
graph-start-end-- Returns:
-
-