org.javanetworkanalyzer.alg
Class DFS<V extends VDFS,E extends EdgeSPT>

java.lang.Object
  extended by org.javanetworkanalyzer.alg.GraphSearchAlgorithm<V,E>
      extended by 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

Field Summary
 
Fields inherited from class org.javanetworkanalyzer.alg.GraphSearchAlgorithm
currentStartNode, graph
 
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 org.javanetworkanalyzer.alg.GraphSearchAlgorithm
init, outdegree, outgoingEdgesOf, outgoingEdgesOf, reconstructTraversalGraph, successorListOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DFS

public DFS(org.jgrapht.Graph<V,E> graph)
Constructor.

Parameters:
graph - The graph.
Method Detail

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.