|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Node - The type of the graph's nodes.public interface IGraph<Node>
Specification of an immutable, unlabeled, directed graph with useful operations on it.
This interface must be used when it is desirable to provide an immutable view of an unlabeled, directed graph to clients even though the underlying implementation may be that of a mutable graph.
Classes implementing this interface are:
MutableGraph, a complete implementation that provides
both, the useful operations and a representation of the
graph.AbstractGraph, a partial implementation that provides
the useful operations but leaves the representation of the
graph unspecified.
| Method Summary | |
|---|---|
AllPathsBuilder<Node> |
getAllPathsBuilder(Node srcNode,
IPathVisitor<Node> visitor,
int maxPathWidth,
int maxPathDepth)
|
java.util.Set<Pair<Node,Node>> |
getBackEdges()
Provides all back edges in a depth-first traversal of the graph reachable from the root nodes. |
IndexMap<Node> |
getNodeMap()
Provides a map from each node in this graph to a unique arbitrary integer in the range [0..N] where N is the total number of nodes in the graph. |
java.util.Set<Node> |
getNodes()
Provides all nodes in this graph. |
java.util.Set<Node> |
getNodesInCycles()
Provides all nodes of the graph reachable from the root nodes that are contained in cycles. |
java.util.List<Node> |
getNodesInRPO()
Provides all nodes in the graph reachable from the root nodes, ordered in Reverse Post Order (RPO). |
java.util.Set<Node> |
getPreds(Node node)
Provides all immediate predecessors of a given node in this graph. |
java.util.Set<Node> |
getRoots()
Provides all root nodes of this graph. |
ShortestPathBuilder<Node> |
getShortestPathsBuilder(Node srcNode,
IPathVisitor<Node> visitor)
|
void |
getSimpleCycles(IGraphEntityVisitor<Node> visitor)
Computes all simple cycles of this graph. |
java.util.Set<Node> |
getSuccs(Node node)
Provides all immediate successors of a given node in this graph. |
java.util.List<java.util.Set<Node>> |
getTopSortedSCCs()
Provides the list of Strongly Connected Components (SCCs) of the graph reachable from its root nodes, sorted in topological order. |
boolean |
hasCycles()
Determines whether the graph reachable from the root nodes contains any cycles. |
boolean |
hasEdge(Node node1,
Node node2)
Determines whether this graph contains a given directed edge. |
boolean |
hasNode(Node node)
Determines whether this graph contains a given node. |
boolean |
hasRoot(Node node)
Determines whether this graph contains a given node as a root node. |
boolean |
isConnected()
Determines whether each node in the graph is reachable from some root node. |
int |
numNodes()
Provides the total number of nodes in this graph. |
int |
numPreds(Node node)
Provides the number of immediate predecessors of a given node in this graph. |
int |
numRoots()
Provides the total number of roots of this graph. |
int |
numSuccs(Node node)
Provides the number of immediate successors of a given node in this graph. |
| Method Detail |
|---|
boolean hasRoot(Node node)
node - A node.
boolean hasNode(Node node)
node - A node.
boolean hasEdge(Node node1,
Node node2)
node1 - A node.node2 - A node.
int numRoots()
int numNodes()
int numPreds(Node node)
node - A node.
int numSuccs(Node node)
node - A node.
java.util.Set<Node> getRoots()
java.util.Set<Node> getNodes()
java.util.Set<Node> getPreds(Node node)
node - A node.
java.util.Set<Node> getSuccs(Node node)
node - A node.
boolean isConnected()
java.util.List<Node> getNodesInRPO()
java.util.List<java.util.Set<Node>> getTopSortedSCCs()
java.util.Set<Pair<Node,Node>> getBackEdges()
boolean hasCycles()
java.util.Set<Node> getNodesInCycles()
void getSimpleCycles(IGraphEntityVisitor<Node> visitor)
visitor - A visitor over the graph's simple cycles.IndexMap<Node> getNodeMap()
ShortestPathBuilder<Node> getShortestPathsBuilder(Node srcNode,
IPathVisitor<Node> visitor)
AllPathsBuilder<Node> getAllPathsBuilder(Node srcNode,
IPathVisitor<Node> visitor,
int maxPathWidth,
int maxPathDepth)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||