datastructures

net.datastructures
Class ConnectivityDFS

java.lang.Object
  extended bynet.datastructures.DFS
      extended bynet.datastructures.ConnectivityDFS

public class ConnectivityDFS
extends DFS

This class specializes DFS to determine whether the graph is connected.


Field Summary
protected  int reached
           
 
Fields inherited from class net.datastructures.DFS
G, STATUS, UNVISITED, VISITED, visitResult
 
Constructor Summary
ConnectivityDFS()
           
 
Method Summary
 Object execute(Graph g, Vertex start, Object info)
          Executes the DFS algorithm.
protected  void startVisit(Vertex v)
          Called when we encounter a vertex (v).
 
Methods inherited from class net.datastructures.DFS
dfsTraversal, finishVisit, init, initResult, isDone, isVisited, result, traverseBack, traverseDiscovery, unVisit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reached

protected int reached
Constructor Detail

ConnectivityDFS

public ConnectivityDFS()
Method Detail

execute

public Object execute(Graph g,
                      Vertex start,
                      Object info)
Executes the DFS algorithm.

Specified by:
execute in class DFS
Parameters:
g - Input graph
start - Start vertex
info - unused variable (can be anything)
Returns:
Boolean with value true if the graph is connected, false otherwise

startVisit

protected void startVisit(Vertex v)
Description copied from class: DFS
Called when we encounter a vertex (v).

Overrides:
startVisit in class DFS

datastructures