Class PathsFinder

java.lang.Object
classycle.graph.PathsFinder

public class PathsFinder extends 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 Details

    • 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 Details

    • getFinalSetCondition

      public VertexCondition getFinalSetCondition()
    • isShortestPathsOnly

      public boolean isShortestPathsOnly()
    • getStartSetCondition

      public VertexCondition getStartSetCondition()
    • 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.