If the present ID used for the result is not of size equal to the number of Vertices in {theGraph}, it deletes the old and constructs a new ID. Starts by iterating through the Vertices of the graph setting the {tmp} variable of each to
. The Vertices are then numbered using a depth first sort of the Graph, with each unmarked Vertex in the Graph at a distance
from starting Vertex being placed in the d'th level set. As this is RCM, the Vertices in level set
are assigned a higher number than those in level set
with the {tmp} variable of the starting Vertex being assigned {numVertices}
. The {tags} of the Vertices are placed into the ID at location given by their {tmp} variable. These are replaced with the {ref} variable of each Vertex, which is returned on successful completion.
The Vertex chosen as the starting Vertex is the one whose tag is given by {lastVertex}. If this is
or the Vertex corresponding to {lastVertex} does not exist then another Vertex is chosen. If the {GPS} flag in constructor is {false} the first Vertex from the Graphs VertexIter is used; if {true} a RCM numbering using the first Vertex from the VertexIter is performed and the Vertices in the last level set are then used to create an ID {lastVertices} with which {number(theGraph, lastVertices)} can be invoked to determine the numbering.
Reimplemented from GraphNumberer.
Definition at line 76 of file RCM.cpp. |