protected LookupTable nodeMap;
private int nrNodes;
private int nrArcs;
public WeightedGraph() {
nodeMap = new DoubleHashingTable();
nrNodes = 0;
nrArcs = 0;
}
This constructs an empty graph. The variables nrNodes and
nrArcs count the numbers of nodes and arcs. Initially there
are none. For definiteness the nodeMap table is implemented
by a
DoubleHashingTable,
but any implementation of the LookupTable interface would serve
as well. Note that the nodeMap table is given
protected status so that extensions of the
WeightedGraph class in the same package can have
access it. The same remark applies to the Node and
Tip classes discussed previously.