Class GraphUtil


  • public class GraphUtil
    extends Object
    A utility for finding the strongly connected components of a graph, implementing Kosaraju's algorithm non-recursively.
    • Constructor Detail

      • GraphUtil

        public GraphUtil()
    • 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: