|
net.datastructures - version 5.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectnet.datastructures.DFS<V,E,Object,Iterable<Position>>
net.datastructures.FindCycleDFS<V,E>
public class FindCycleDFS<V,E>
This class specializes DFS to find a cycle.
| Field Summary | |
|---|---|
protected PositionList<Position> |
cycle
|
protected Vertex<V> |
cycleStart
|
protected boolean |
done
|
| Fields inherited from class net.datastructures.DFS |
|---|
graph, info, start, STATUS, UNVISITED, VISITED, visitResult |
| Constructor Summary | |
|---|---|
FindCycleDFS()
|
|
| Method Summary | |
|---|---|
Iterable<Position> |
finalResult(Iterable<Position> r)
Returns the final result of the DFS execute method. |
protected void |
finishVisit(Vertex<V> v)
Called after we finish the visit for a vertex (v). |
protected boolean |
isDone()
Determines whether the traversal is done early. |
void |
setup()
Executes the DFS algorithm. |
protected void |
startVisit(Vertex<V> v)
Called when we encounter a vertex (v). |
protected void |
traverseBack(Edge<E> e,
Vertex<V> from)
Called when we traverse a back edge (e) from a vertex (from). |
protected void |
traverseDiscovery(Edge<E> e,
Vertex<V> from)
Called when we traverse a discovery edge (e) from a vertex (from). |
| Methods inherited from class net.datastructures.DFS |
|---|
dfsTraversal, execute, initResult, isVisited, result, unVisit, visit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PositionList<Position> cycle
protected boolean done
protected Vertex<V> cycleStart
| Constructor Detail |
|---|
public FindCycleDFS()
| Method Detail |
|---|
public void setup()
setup in class DFS<V,E,Object,Iterable<Position>>info - unusedprotected void startVisit(Vertex<V> v)
DFS
startVisit in class DFS<V,E,Object,Iterable<Position>>protected void finishVisit(Vertex<V> v)
DFS
finishVisit in class DFS<V,E,Object,Iterable<Position>>
protected void traverseDiscovery(Edge<E> e,
Vertex<V> from)
DFS
traverseDiscovery in class DFS<V,E,Object,Iterable<Position>>
protected void traverseBack(Edge<E> e,
Vertex<V> from)
DFS
traverseBack in class DFS<V,E,Object,Iterable<Position>>protected boolean isDone()
DFS
isDone in class DFS<V,E,Object,Iterable<Position>>public Iterable<Position> finalResult(Iterable<Position> r)
DFS
finalResult in class DFS<V,E,Object,Iterable<Position>>
|
net.datastructures - version 5.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||