public interface Graph
GraphNode
,
GraphEdge
,
GraphUtilities
Modifier and Type | Method and Description |
---|---|
void |
addGraphEdge(GraphNode source,
GraphNode target)
Add a new edge to a graph.
|
void |
addGraphNode(GraphNode node)
Add a new graph node to the graph.
|
void |
compactNodeNumbering()
After this method is called, all nodes in the graph should
have a compact numbering from 0 to (number of nodes in
graph - 1).
|
Enumeration<GraphNode> |
enumerateNodes()
This method lists all of the nodes in a given graph.
|
int |
numberOfNodes()
Find out how many nodes are in the graph
|
Enumeration<GraphNode> enumerateNodes()
GraphNode
int numberOfNodes()
void compactNodeNumbering()
GraphNode.getIndex
. This
method is used by clients that want to e.g. allocate look-aside
storage for graph nodes in an
array.void addGraphNode(GraphNode node)
node
- the node to add to the graphvoid addGraphEdge(GraphNode source, GraphNode target)
source
- the source node of the edge to addtarget
- the target node of the edge to add