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.


Variable Index

 o markedVerts
 o tester

Constructor Index

 o NumConnectedComponents()

Method Index

 o isMarked(Vertex)
 o mark(Vertex)
 o numComponents(InspectableGraph)

Variables

 o tester
 protected DFS tester
 o markedVerts
 protected Hashtable markedVerts

Constructors

 o NumConnectedComponents
 public NumConnectedComponents()

Methods

 o numComponents
 public int numComponents(InspectableGraph g)
 o mark
 protected void mark(Vertex v)
 o isMarked
 protected boolean isMarked(Vertex v)

All Packages  Class Hierarchy  This Package  Previous  Next  Index