public class MemoryEfficientGraph<N> extends HashMutableDirectedGraph<N>
heads, nodeToPreds, nodeToSuccs, tails
Constructor and Description |
---|
MemoryEfficientGraph() |
Modifier and Type | Method and Description |
---|---|
void |
addEdge(N from,
N to)
Adds an edge to the graph between 2 nodes.
|
void |
addNode(N o)
Adds a node to the graph.
|
void |
removeEdge(N from,
N to)
Removes an edge between 2 nodes in the graph.
|
void |
removeNode(N o)
Removes a node from the graph.
|
clearAll, clone, containsEdge, containsNode, getHeads, getNodes, getPredsOf, getPredsOfAsSet, getSuccsOf, getSuccsOfAsSet, getTails, iterator, printGraph, size
public void addNode(N o)
MutableDirectedGraph
addNode
in interface MutableDirectedGraph<N>
addNode
in class HashMutableDirectedGraph<N>
o
- a node to add to the graph.DirectedGraph.getHeads()
,
DirectedGraph.getTails()
public void removeNode(N o)
MutableDirectedGraph
removeNode
in interface MutableDirectedGraph<N>
removeNode
in class HashMutableDirectedGraph<N>
o
- the node to be removed.public void addEdge(N from, N to)
MutableDirectedGraph
addEdge
in interface MutableDirectedGraph<N>
addEdge
in class HashMutableDirectedGraph<N>
from
- out node for the edge.to
- in node for the edge.public void removeEdge(N from, N to)
MutableDirectedGraph
removeEdge
in interface MutableDirectedGraph<N>
removeEdge
in class HashMutableDirectedGraph<N>
from
- out node for the edge to remove.to
- in node for the edge to remove.