All Packages Class Hierarchy This Package Previous Next Index
Class jdsl.core.algo.graphtraversals.NumConnectedComponents
java.lang.Object
|
+----jdsl.core.algo.graphtraversals.NumConnectedComponents
- public class NumConnectedComponents
- extends Object
This algorithm computes the number of connected components of a
graph using depth-first search. The algorithm examins all vertices
in the graph, and uses each unmarked vertex as a start vertex as
start vertex for DFS. After each DFS is performed, the vertices in
the connected component of the start vertex are marked so that they
are not examined again.
- Version:
- Tue Sep 2 17:57:40 1997
- Author:
- Natasha Gelfand
-
markedVerts
-
-
tester
-
-
NumConnectedComponents()
-
-
isMarked(Vertex)
-
-
mark(Vertex)
-
-
numComponents(InspectableGraph)
-
tester
protected DFS tester
markedVerts
protected Hashtable markedVerts
NumConnectedComponents
public NumConnectedComponents()
numComponents
public int numComponents(InspectableGraph g)
mark
protected void mark(Vertex v)
isMarked
protected boolean isMarked(Vertex v)
All Packages Class Hierarchy This Package Previous Next Index