public class DFSAllPathsFinder<T> extends DFSPathFinder<T>
DFSPathFinder to discover all paths from a set of root nodes to nodes passing
some Predicate.
Note that this code performs work that is potentially exponential in the size of the underlying graph, using exponential space. It most likely won't work even for graphs of moderate size.
G, pendingChildrenmodCount| Constructor and Description |
|---|
DFSAllPathsFinder(Graph<T> G,
Iterator<T> nodes,
Predicate<T> f) |
DFSAllPathsFinder(Graph<T> G,
T N,
Predicate<T> f) |
| Modifier and Type | Method and Description |
|---|---|
protected Iterator<? extends T> |
getConnected(T n)
get the out edges of a given node
|
protected Iterator<? extends T> |
getPendingChildren(T n)
Method getPendingChildren.
|
protected void |
setPendingChildren(T v,
Iterator<? extends T> iterator)
Method setPendingChildren.
|
currentPath, find, hasNextadd, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeequals, hashCodecontainsAll, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcontainsAll, equals, hashCodeparallelStream, streampublic DFSAllPathsFinder(Graph<T> G, T N, Predicate<T> f) throws IllegalArgumentException
IllegalArgumentExceptionprotected Iterator<? extends T> getConnected(T n)
DFSPathFindergetConnected in class DFSPathFinder<T>n - the node of which to get the out edgesprotected Iterator<? extends T> getPendingChildren(T n)
DFSPathFindergetPendingChildren in class DFSPathFinder<T>protected void setPendingChildren(T v, Iterator<? extends T> iterator)
DFSPathFindersetPendingChildren in class DFSPathFinder<T>