Class GraphPlume

java.lang.Object
org.plumelib.util.GraphPlume

public final class GraphPlume extends Object
Graph utility methods. This class does not model a graph: all methods are static.
  • Method Details

    • dominators

      public static <T extends @NonNull Object> Map<T,List<T>> dominators(Map<T,List<@KeyFor("#1") T>> predecessors)
      Computes, for each node in the graph, its set of (pre-)dominators. Supply a successor graph if you want post-dominators.
      Type Parameters:
      T - type of the graph nodes
      Parameters:
      predecessors - a graph, represented as a predecessor map
      Returns:
      a map from each node to a list of its pre-dominators
    • print

      public static <T extends @NonNull Object> void print(Map<T,List<T>> graph, PrintStream ps, int indent)
      Print a representation of the graph to ps, indented by intent spaces.
      Type Parameters:
      T - the type of nodes of the graph
      Parameters:
      graph - the graph to print
      ps - the PrintStream to which to print the graph
      indent - the number of spaces by which to indent the printed representation