public class BFS<V>
extends java.lang.Object
| Constructor and Description |
|---|
BFS() |
| Modifier and Type | Method and Description |
|---|---|
static <V> java.util.Set<V> |
collectNodesAlongPath(V source,
V target,
IGraphDataSource<V> graph)
Performs a breadth first search on the given graph and collects all the nodes along the path from source to
target if such path exists.
|
static <V> boolean |
isReachable(V source,
V target,
IGraphDataSource<V> graph)
Performs a breadth first search on the given graph to determine whether source is reachable from target.
|
static <V> java.util.Set<V> |
reachableSources(IBiDirectionalGraphDataSource<V> graph,
V target) |
static <V> java.util.Set<V> |
reachableTargets(IGraphDataSource<V> graph,
V source) |
public static <V> boolean isReachable(V source,
V target,
IGraphDataSource<V> graph)
V - the type parameter of the nodes in the graphsource - the source nodetarget - the target nodegraph - the graph data sourcepublic static <V> java.util.Set<V> reachableSources(IBiDirectionalGraphDataSource<V> graph, V target)
public static <V> java.util.Set<V> reachableTargets(IGraphDataSource<V> graph, V source)
public static <V> java.util.Set<V> collectNodesAlongPath(V source,
V target,
IGraphDataSource<V> graph)
V - the type parameter of the nodes in the graphsource - the source nodetarget - the target nodegraph - the graph data source