Class PathsFinder


  • public class PathsFinder
    extends java.lang.Object
    Class searching for all (or only the shortest) paths between classes of a start set and classes of a final set.
    Author:
    Franz-Josef Elmer
    • Constructor Detail

      • PathsFinder

        public PathsFinder​(VertexCondition startSetCondition,
                           VertexCondition finalSetCondition,
                           boolean shortestPathsOnly)
        Creates an instance for the specified vertex conditions.
        Parameters:
        startSetCondition - Condition defining the start set.
        finalSetCondition - Condition defining the final set.
        shortestPathsOnly - if true only the shortest paths are returned.
      • PathsFinder

        public PathsFinder​(VertexCondition startSetCondition,
                           VertexCondition finalSetCondition,
                           boolean shortestPathsOnly,
                           boolean directPathsOnly)
        Creates an instance for the specified vertex conditions.
        Parameters:
        startSetCondition - Condition defining the start set.
        finalSetCondition - Condition defining the final set.
        shortestPathsOnly - if true only the shortest paths are returned.
        directPathsOnly - if true only paths of length 1 are returned.
    • Method Detail

      • isShortestPathsOnly

        public boolean isShortestPathsOnly()
      • findPaths

        public AtomicVertex[] findPaths​(AtomicVertex[] graph)
        Finds all paths from the specified start vertices to the vertices fullfilling the specified condition.
        Parameters:
        graph - Complete graph.
        Returns:
        All vertices including start and end vertices defining the subgraph with all paths.