In the second phase the n nearest neighbors of each data point are found
according to the geodesic distance computed by Dijkstra's algorithm. This algo-
rithm begins at a specic node (source vertex) and extends outward within the
graph until all the vertices have been reached (in our case only the n nearest
nodes). Dijkstra's algorithm creates labels associated with vertices. These labels
represent the distance (cost) from the source vertex to that particular vertex.
Within the graph, there exists two kinds of labels: temporary and permanent.
The temporary labels are given to vertices that have not been reached. The value
given to these temporary labels can vary. Permanent labels are given to vertices
that have been reached and their distance (cost) to the source vertex is known.
The value given to these labels is the distance (cost) of that vertex to the source
vertex. For any given vertex, there must be a permanent label or a temporary
label, but not both. An animated example of Dijkstra's algorithm can be seen
at [13]. Both steps of the neighboring search are detailed in the following: