net.datastructures
Class ComponentsDFS<V,E>
java.lang.Object
net.datastructures.DFS<V,E,Object,Integer>
net.datastructures.ComponentsDFS<V,E>
public class ComponentsDFS<V,E>
- extends DFS<V,E,Object,Integer>
This class extends DFS to compute the connected components of a graph.
Method Summary |
protected Integer |
finalResult(Integer dfsResult)
Returns the final result of the DFS execute method. |
protected void |
setup()
Setup method that is called prior to the DFS execution. |
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 |
compNumber
protected Integer compNumber
COMPONENT
protected Object COMPONENT
ComponentsDFS
public ComponentsDFS()
setup
protected void setup()
- Description copied from class:
DFS
- Setup method that is called prior to the DFS execution.
- Overrides:
setup
in class DFS<V,E,Object,Integer>
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,Integer>
finalResult
protected Integer finalResult(Integer dfsResult)
- Description copied from class:
DFS
- Returns the final result of the DFS execute method.
- Overrides:
finalResult
in class DFS<V,E,Object,Integer>