Class ChkPostDominanceAlgorithm<V,​E extends GEdge<V>>

  • Type Parameters:
    V - the vertex type
    E - the edge type

    public class ChkPostDominanceAlgorithm<V,​E extends GEdge<V>>
    extends ChkDominanceAlgorithm<V,​E>
    This is ChkDominanceAlgorithm with reverse graph traversal, which allows the algorithm to calculate post dominance.
    • Method Detail

      • unifySources

        protected static <V,​E extends GEdge<V>> V unifySources​(MutableGDirectedGraphWrapper<V,​E> graph,
                                                                     GraphNavigator<V,​E> graphNavigator)
        Converts multiple source/root nodes in a graph into a single source of which those become children.
        Parameters:
        graph - the graph
        graphNavigator - the navigator to determine graph direction
        Returns:
        the new single source
        Throws:
        java.lang.IllegalArgumentException - if there is not at least one source node in the graph
      • unifySinks

        protected static <V,​E extends GEdge<V>> V unifySinks​(MutableGDirectedGraphWrapper<V,​E> graph,
                                                                   GraphNavigator<V,​E> graphNavigator)
        Converts multiple sink/exit nodes in a graph into a single sink of which those become parents.
        Parameters:
        graph - the graph
        graphNavigator - the navigator to determine graph direction
        Returns:
        the new single sink
        Throws:
        java.lang.IllegalArgumentException - if there is not at least one sink node in the graph