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, pendingChildren, serialVersionUID
capacityIncrement, elementCount, elementData
modCount
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, hasNext
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSize
finalize, getClass, notify, notifyAll, wait, wait, wait
parallelStream, stream
public DFSAllPathsFinder(Graph<T> G, T N, Predicate<T> f) throws IllegalArgumentException
IllegalArgumentException
protected Iterator<? extends T> getConnected(T n)
DFSPathFinder
getConnected
in class DFSPathFinder<T>
n
- the node of which to get the out edgesprotected Iterator<? extends T> getPendingChildren(T n)
DFSPathFinder
getPendingChildren
in class DFSPathFinder<T>
protected void setPendingChildren(T v, Iterator<? extends T> iterator)
DFSPathFinder
setPendingChildren
in class DFSPathFinder<T>