|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsbrt.kernel.math.graph_theory.comp.PathFinder<N>
N
- the node type.public class PathFinder<N>
This class is an implemenation of an algorithm for finding all pathways in a directed graph.
Constructor Summary | |
---|---|
PathFinder(DirectedGraph<N> graph)
Constructs a new path finder for the provided graph. |
Method Summary | ||
---|---|---|
DirectedGraph<N> |
getGraph()
Returns the graph in which pathways will be computed. |
|
java.util.List<Path<N>> |
getPaths()
Returns a list of all paths. |
|
java.util.List<Path<N>> |
getPaths(java.util.Collection<? extends N> sources,
java.util.Collection<? extends N> sinks)
Returns a list of all paths between the provided source and sink nodes. |
|
|
getPaths(T source,
S sink)
Returns a list of all paths between the provided source and sink nodes. |
|
int |
paths()
Returns the total number of paths. |
|
int |
paths(java.util.Collection<? extends N> sources,
java.util.Collection<? extends N> sinks)
Returns the number of paths between the provided source and sink nodes. |
|
|
paths(T source,
S sink)
Returns the number of paths between the provided source and sink nodes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PathFinder(DirectedGraph<N> graph)
graph
- the directed graph in which pathways will be computed.Method Detail |
---|
public DirectedGraph<N> getGraph()
public java.util.List<Path<N>> getPaths()
public java.util.List<Path<N>> getPaths(java.util.Collection<? extends N> sources, java.util.Collection<? extends N> sinks)
sources
- the collection of nodes at which all returned paths will
begin.sinks
- the collection of nodes at which all returned paths will end.
public <T extends N,S extends N> java.util.List<Path<N>> getPaths(T source, S sink)
T
- a type extending the primary node type.S
- a type extending the primary node type.source
- the node at which all returned paths will begin.sink
- the node at which all returned paths will end.
public <T extends N,S extends N> int paths(T source, S sink)
T
- a type extending the primary node type.S
- a type extending the primary node type.source
- the node at which all computed paths will begin.sink
- the node at which all computed paths will end.
public int paths()
public int paths(java.util.Collection<? extends N> sources, java.util.Collection<? extends N> sinks)
sources
- the collection of nodes at which all computed paths will
begin.sinks
- the collection of nodes at which all computed paths will end.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |