All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jdsl.core.algo.graphtraversals.FindCycleDFS

java.lang.Object
   |
   +----jdsl.core.algo.graphtraversals.DFS
           |
           +----jdsl.core.algo.graphtraversals.FindCycleDFS

public class FindCycleDFS
extends DFS
This class specializes DFS to determine if the connected component of the start vertex contains a cycle and if so return it. The algorithm returns an enumeration of vertices in the cycle or an empty enumeration if there is no cycle.


Variable Index

 o cycleStart
 o done
 o path

Constructor Index

 o FindCycleDFS()

Method Index

 o execute(InspectableGraph, Vertex, Object)
Runs the depth first search algorithm on a graph.
 o finishVisit(Vertex)
Called when the search has finished with the vertex.
 o isDone()
Tests if the depth first search is done.
 o startVisit(Vertex)
Called when a vertex is visited.
 o traverseBack(Edge, Vertex)
Called when a back edge is traversed.

Variables

 o path
 protected Sequence path
 o done
 protected boolean done
 o cycleStart
 protected Vertex cycleStart

Constructors

 o FindCycleDFS
 public FindCycleDFS()

Methods

 o execute
 public Object execute(InspectableGraph g,
                       Vertex start,
                       Object info)
Runs the depth first search algorithm on a graph.

Overrides:
execute in class DFS
 o startVisit
 protected void startVisit(Vertex v)
Called when a vertex is visited.

Overrides:
startVisit in class DFS
 o finishVisit
 protected void finishVisit(Vertex v)
Called when the search has finished with the vertex.

Overrides:
finishVisit in class DFS
 o traverseBack
 protected void traverseBack(Edge e,
                             Vertex from)
Called when a back edge is traversed.

Overrides:
traverseBack in class DFS
 o isDone
 protected boolean isDone()
Tests if the depth first search is done.

Overrides:
isDone in class DFS

All Packages  Class Hierarchy  This Package  Previous  Next  Index