Interface BaseTopologicalOrderGraph

All Known Subinterfaces:
TopologicalOrderGraph
All Known Implementing Classes:
DefaultTopologicalOrderGraph

public interface BaseTopologicalOrderGraph
Exists to expose read-only view of TopologicalOrderGraph.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    Stores a graph node id and dynamically calculates its topological order.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns a tuple containing node ID and a number corresponding to its topological order.
    boolean
    isLooped(LoopedTracker loopedTracker, int node)
    Returns true if a given node is in a strongly connected component with a size greater than 1 (i.e. is in a loop) or is a transitive successor of a node with the above property.
    nodeForwardEdges(int from)
    Return an iterator of the nodes that have the `from` node as a predecessor.
  • Method Details

    • nodeForwardEdges

      PrimitiveIterator.OfInt nodeForwardEdges(int from)
      Return an iterator of the nodes that have the `from` node as a predecessor.
      Parameters:
      from - The predecessor node.
      Returns:
      an iterator of nodes with from as a predecessor.
    • isLooped

      boolean isLooped(LoopedTracker loopedTracker, int node)
      Returns true if a given node is in a strongly connected component with a size greater than 1 (i.e. is in a loop) or is a transitive successor of a node with the above property.
      Parameters:
      loopedTracker - a tracker that can be used to record looped state to avoid recomputation.
      node - The node being queried
      Returns:
      true if `node` is in a loop, false otherwise.
    • getTopologicalOrder

      int getTopologicalOrder(int node)
      Returns a tuple containing node ID and a number corresponding to its topological order. In particular, after TopologicalOrderGraph.commitChanges(java.util.BitSet) is called, the following must be true for any pair of nodes A, B where:
      • A is a predecessor of B
      • `isLooped(A) == isLooped(B) == false`
      getTopologicalOrder(A) < getTopologicalOrder(B)

      Said number may not be unique.