org.javanetworkanalyzer.alg
Class DFS<V extends VDFS,E extends EdgeSPT>
java.lang.Object
org.javanetworkanalyzer.alg.GraphSearchAlgorithm<V,E>
org.javanetworkanalyzer.alg.DFS<V,E>
- Type Parameters:
V - The data structure to hold node information during the execution
of DFS.
- All Implemented Interfaces:
- TraversalAlg<V,E>
- Direct Known Subclasses:
- DFSForStrahler
public class DFS<V extends VDFS,E extends EdgeSPT>
- extends GraphSearchAlgorithm<V,E>
Root Depth First Search (DFS) class.
- Author:
- Adam Gouge
|
Constructor Summary |
DFS(org.jgrapht.Graph<V,E> graph)
Constructor. |
|
Method Summary |
void |
calculate()
Does the depth first search for all nodes in the graph. |
void |
calculate(V startNode)
Does a depth first search from the given start node. |
protected void |
visit(V node)
Visit the given node, updating its predecessor and discovery and
finishing times. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DFS
public DFS(org.jgrapht.Graph<V,E> graph)
- Constructor.
- Parameters:
graph - The graph.
calculate
public void calculate()
- Does the depth first search for all nodes in the graph.
calculate
public void calculate(V startNode)
- Does a depth first search from the given start node.
- Parameters:
startNode - Start node
visit
protected void visit(V node)
- Visit the given node, updating its predecessor and discovery and
finishing times.
- Parameters:
node - The node.
Copyright © 2014. All Rights Reserved.