java.lang.Object
tools.refinery.interpreter.rete.itc.alg.misc.bfs.BFS<V>

public class BFS<V> extends Object
  • Method Details

    • 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> Set<V> reachableSources(IBiDirectionalGraphDataSource<V> graph, V target)
    • reachableTargets

      public static <V> Set<V> reachableTargets(IGraphDataSource<V> graph, V source)
    • collectNodesAlongPath

      public static <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.
      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