Interface IGraphPathFinder<V>

Type Parameters:
V - the node type of the graph
All Known Implementing Classes:
DFSPathFinder

public interface IGraphPathFinder<V>
The path finder provides methods for retrieving paths in a graph between a source node and one or more target nodes. Use ITcDataSource.getPathFinder() for instantiating.
  • Method Summary

    Modifier and Type
    Method
    Description
    getAllPaths(V sourceNode, V targetNode)
    Returns the collection of paths from the source node to the target node (if such exists).
    getAllPathsToTargets(V sourceNode, Set<V> targetNodes)
    Returns the collection of paths from the source node to any of the target nodes (if such exists).
    getPath(V sourceNode, V targetNode)
    Returns an arbitrary path from the source node to the target node (if such exists).
    getShortestPaths(V sourceNode, V targetNode)
    Returns the collection of shortest paths from the source node to the target node (if such exists).
  • Method Details

    • getPath

      Deque<V> getPath(V sourceNode, V targetNode)
      Returns an arbitrary path from the source node to the target node (if such exists). If there is no path between them, an empty collection is returned.
      Parameters:
      sourceNode - the source node of the path
      targetNode - the target node of the path
      Returns:
      the path from the source to the target, or empty collection if target is not reachable from source.
    • getShortestPaths

      Iterable<Deque<V>> getShortestPaths(V sourceNode, V targetNode)
      Returns the collection of shortest paths from the source node to the target node (if such exists). If there is no path between them, an empty collection is returned.
      Parameters:
      sourceNode - the source node of the path
      targetNode - the target node of the path
      Returns:
      the collection of shortest paths from the source to the target, or empty collection if target is not reachable from source.
    • getAllPaths

      Iterable<Deque<V>> getAllPaths(V sourceNode, V targetNode)
      Returns the collection of paths from the source node to the target node (if such exists). If there is no path between them, an empty collection is returned.
      Parameters:
      sourceNode - the source node of the path
      targetNode - the target node of the path
      Returns:
      the collection of paths from the source to the target, or empty collection if target is not reachable from source.
    • getAllPathsToTargets

      Iterable<Deque<V>> getAllPathsToTargets(V sourceNode, Set<V> targetNodes)
      Returns the collection of paths from the source node to any of the target nodes (if such exists). If there is no path between them, an empty collection is returned.
      Parameters:
      sourceNode - the source node of the path
      targetNodes - the set of target nodes of the paths
      Returns:
      the collection of paths from the source to any of the targets, or empty collection if neither target is reachable from source.