net.datastructures
Class ConnectivityDFS<V,E>
java.lang.Object
net.datastructures.DFS<V,E,Object,Boolean>
net.datastructures.ConnectivityDFS<V,E>
public class ConnectivityDFS<V,E>
- extends DFS<V,E,Object,Boolean>
This class specializes DFS to determine whether the graph is connected.
Field Summary |
protected int |
reached
|
Method Summary |
protected Boolean |
finalResult(Boolean dfsResult)
Returns the final result of the DFS execute method. |
protected void |
setup()
Executes the DFS algorithm. |
protected void |
startVisit(Vertex<V> v)
Called when we encounter a vertex (v). |
Methods inherited from class net.datastructures.DFS |
dfsTraversal, execute, finishVisit, 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 |
reached
protected int reached
ConnectivityDFS
public ConnectivityDFS()
setup
protected void setup()
- Executes the DFS algorithm.
- Overrides:
setup
in class DFS<V,E,Object,Boolean>
- Parameters:
graph
- Input graphstart
- Start vertexinfo
- unused
startVisit
protected void startVisit(Vertex<V> v)
- Description copied from class:
DFS
- Called when we encounter a vertex (v).
- Overrides:
startVisit
in class DFS<V,E,Object,Boolean>
finalResult
protected Boolean finalResult(Boolean dfsResult)
- Description copied from class:
DFS
- Returns the final result of the DFS execute method.
- Overrides:
finalResult
in class DFS<V,E,Object,Boolean>