org.eclipse.incquery.runtime.base.itc.alg.misc.bfs

## Class BFS<V>

- java.lang.Object
- - org.eclipse.incquery.runtime.base.itc.alg.misc.bfs.BFS<V>

-     public class BFS<V>
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BFS()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    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)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BFS

          public BFS()

  - ### Method Detail

    - #### isReachable

          public 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.
      Type Parameters:
        `V` - the type parameter of the nodes in the graph
      Parameters:
        `source` - the source node
        `target` - the target node
        `graph` - the graph data source
      Returns:
        true if source is reachable from target, false otherwise

    - #### reachableSources

          public static <V> java.util.Set<V> reachableSources(IBiDirectionalGraphDataSource<V> graph,
                                                              V target)

    - #### reachableTargets

          public static <V> java.util.Set<V> reachableTargets(IGraphDataSource<V> graph,
                                                              V source)

    - #### collectNodesAlongPath

          public 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.
      Type Parameters:
        `V` - the type parameter of the nodes in the graph
      Parameters:
        `source` - the source node
        `target` - the target node
        `graph` - the graph data source
      Returns:
        the set of nodes along the path