|
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,Vertex<V>,Iterable<Position>>
net.datastructures.FindPathDFS<V,E>
public class FindPathDFS<V,E>
Class specializing DFS to find a path between a start vertex and a target vertex. It assumes the target vertex is passed as the info object to the execute method. It returns an iterable list of the vertices and edges comprising the path from start to info. The returned path is empty if info is unreachable from start.
Field Summary | |
---|---|
protected boolean |
done
|
protected PositionList<Position> |
path
|
Fields inherited from class net.datastructures.DFS |
---|
graph, info, start, STATUS, UNVISITED, VISITED, visitResult |
Constructor Summary | |
---|---|
FindPathDFS()
|
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()
Setup method to initialize the path. |
protected void |
startVisit(Vertex<V> v)
Called when we encounter a vertex (v). |
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, traverseBack, 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> path
protected boolean done
Constructor Detail |
---|
public FindPathDFS()
Method Detail |
---|
public void setup()
setup
in class DFS<V,E,Vertex<V>,Iterable<Position>>
protected void startVisit(Vertex<V> v)
DFS
startVisit
in class DFS<V,E,Vertex<V>,Iterable<Position>>
protected void finishVisit(Vertex<V> v)
DFS
finishVisit
in class DFS<V,E,Vertex<V>,Iterable<Position>>
protected void traverseDiscovery(Edge<E> e, Vertex<V> from)
DFS
traverseDiscovery
in class DFS<V,E,Vertex<V>,Iterable<Position>>
protected boolean isDone()
DFS
isDone
in class DFS<V,E,Vertex<V>,Iterable<Position>>
public Iterable<Position> finalResult(Iterable<Position> r)
DFS
finalResult
in class DFS<V,E,Vertex<V>,Iterable<Position>>
|
net.datastructures - version 5.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |