Class BFS<V>
java.lang.Object
tools.refinery.interpreter.rete.itc.alg.misc.bfs.BFS<V>
-
Method Summary
Modifier and TypeMethodDescriptionstatic <V> 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> Set
<V> reachableSources
(IBiDirectionalGraphDataSource<V> graph, V target) static <V> Set
<V> reachableTargets
(IGraphDataSource<V> graph, V source)
-
Method Details
-
isReachable
Performs a breadth first search on the given graph to determine whether source is reachable from target.- Type Parameters:
V
- the type parameter of the nodes in the graph- Parameters:
source
- the source nodetarget
- the target nodegraph
- the graph data source- Returns:
- true if source is reachable from target, false otherwise
-
reachableSources
-
reachableTargets
-
collectNodesAlongPath
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.- Type Parameters:
V
- the type parameter of the nodes in the graph- Parameters:
source
- the source nodetarget
- the target nodegraph
- the graph data source- Returns:
- the set of nodes along the path
-