Class ComponentFactory


  • public class ComponentFactory
    extends java.lang.Object
    • Constructor Detail

      • ComponentFactory

        public ComponentFactory()
    • Method Detail

      • componentize

        public static <N extends DirectedGraphNode,​E extends DirectedGraphEdge<? extends N,​? extends N>> java.util.Collection<java.util.Collection<N>> componentize​(DirectedGraph<N,​E> graph)
        Computes strongly connected components for the given directed graph.
        Type Parameters:
        N - Node type of the graph
        E - Edge type of the graph
        Parameters:
        graph - The graph to componentize
        Returns:
        The set of strongly connected components of the graph
      • isTerminal

        public static <N extends DirectedGraphNode,​E extends DirectedGraphEdge<? extends N,​? extends N>> boolean isTerminal​(DirectedGraph<N,​E> graph,
                                                                                                                                        java.util.Collection<N> component)
        Checks whether a component is terminal, that is, whether it has no outgoing edges.
        Type Parameters:
        N - The type of nodes in the graph
        E - The type of edges in the graph
        Parameters:
        graph - The given graph
        component - The given component
        Returns:
        Whether the component is terminal