net.datastructures
Class FindPathDFS<V,E>
java.lang.Object
net.datastructures.DFS<V,E,Vertex<V>,java.lang.Iterable<Position>>
net.datastructures.FindPathDFS<V,E>
public class FindPathDFS<V,E>
- extends DFS<V,E,Vertex<V>,java.lang.Iterable<Position>>
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.
Method Summary |
java.lang.Iterable<Position> |
finalResult(java.lang.Iterable<Position> r)
Returns the final result of the DFS execute method. |
void |
setup()
Setup method to initialize the path. |
Methods inherited from class net.datastructures.DFS |
execute |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FindPathDFS
public FindPathDFS()
setup
public void setup()
- Setup method to initialize the path.
finalResult
public java.lang.Iterable<Position> finalResult(java.lang.Iterable<Position> r)
- Description copied from class:
DFS
- Returns the final result of the DFS execute method.