V - the node type of the graphpublic class DFSPathFinder<V> extends java.lang.Object implements IGraphPathFinder<V>
IGraphPathFinder.
TODO use ITC to filter nodes that must be traversed, instead of checks| Constructor and Description |
|---|
DFSPathFinder(IGraphDataSource<V> graph,
ITcDataSource<V> itc) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Iterable<java.util.Deque<V>> |
getAllPaths(V sourceNode,
V targetNode)
Returns the collection of paths from the source node to the target node (if such exists).
|
java.lang.Iterable<java.util.Deque<V>> |
getAllPathsToTargets(V sourceNode,
java.util.Set<V> targetNodes)
Returns the collection of paths from the source node to any of the target nodes (if such exists).
|
java.util.Deque<V> |
getPath(V sourceNode,
V targetNode)
Returns an arbitrary path from the source node to the target node (if such exists).
|
protected java.lang.Iterable<java.util.Deque<V>> |
getPaths(java.util.List<java.util.Deque<V>> paths,
java.util.Deque<V> visited,
java.util.Set<V> targetNodes) |
java.lang.Iterable<java.util.Deque<V>> |
getShortestPaths(V sourceNode,
V targetNode)
Returns the collection of shortest paths from the source node to the target node (if such exists).
|
java.lang.String |
printPaths(java.util.List<java.util.Deque<V>> paths) |
public DFSPathFinder(IGraphDataSource<V> graph, ITcDataSource<V> itc)
public java.lang.Iterable<java.util.Deque<V>> getAllPaths(V sourceNode, V targetNode)
IGraphPathFindergetAllPaths in interface IGraphPathFinder<V>sourceNode - the source node of the pathtargetNode - the target node of the pathpublic java.lang.Iterable<java.util.Deque<V>> getAllPathsToTargets(V sourceNode, java.util.Set<V> targetNodes)
IGraphPathFindergetAllPathsToTargets in interface IGraphPathFinder<V>sourceNode - the source node of the pathtargetNodes - the set of target nodes of the pathsprotected java.lang.Iterable<java.util.Deque<V>> getPaths(java.util.List<java.util.Deque<V>> paths, java.util.Deque<V> visited, java.util.Set<V> targetNodes)
public java.lang.String printPaths(java.util.List<java.util.Deque<V>> paths)
public java.util.Deque<V> getPath(V sourceNode, V targetNode)
IGraphPathFindergetPath in interface IGraphPathFinder<V>sourceNode - the source node of the pathtargetNode - the target node of the pathpublic java.lang.Iterable<java.util.Deque<V>> getShortestPaths(V sourceNode, V targetNode)
IGraphPathFindergetShortestPaths in interface IGraphPathFinder<V>sourceNode - the source node of the pathtargetNode - the target node of the path