|
datastructures | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.datastructures.DFS
net.datastructures.FindPathDFS
This class specializes DFS to find a path between the start vertex and a given target vertex.
Field Summary | |
protected boolean |
done
|
protected List |
path
|
protected Vertex |
target
|
Fields inherited from class net.datastructures.DFS |
G, STATUS, UNVISITED, VISITED, visitResult |
Constructor Summary | |
FindPathDFS()
|
Method Summary | |
Object |
execute(Graph g,
Vertex start,
Object info)
Execute a depth first search traversal on graph g, starting from a vertex v, optionally passing in an information object (info) |
protected void |
finishVisit(Vertex v)
Called after we finish the visit for a vertex (v). |
protected boolean |
isDone()
Determines whether the traversal is done early. |
protected void |
startVisit(Vertex v)
Called when we encounter a vertex (v). |
protected void |
traverseDiscovery(Edge e,
Vertex from)
Called when we traverse a discovery edge (e) from a vertex (from). |
Methods inherited from class net.datastructures.DFS |
dfsTraversal, init, initResult, isVisited, result, traverseBack, unVisit, visit |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected List path
protected boolean done
protected Vertex target
Constructor Detail |
public FindPathDFS()
Method Detail |
public Object execute(Graph g, Vertex start, Object info)
DFS
execute
in class DFS
info
- target vertex of the pathg
- Input graph.start
- Start vertex of the traversal.
Iterator
of the vertices and edges in a path
from the start vertex to the target vertex, or an empty iterator
if no such path exists in the graphprotected void startVisit(Vertex v)
DFS
startVisit
in class DFS
protected void finishVisit(Vertex v)
DFS
finishVisit
in class DFS
protected void traverseDiscovery(Edge e, Vertex from)
DFS
traverseDiscovery
in class DFS
protected boolean isDone()
DFS
isDone
in class DFS
|
datastructures | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |