Package classycle.graph
Class PathsFinder
- java.lang.Object
-
- classycle.graph.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 Summary
Constructors Constructor Description PathsFinder(VertexCondition startSetCondition, VertexCondition finalSetCondition, boolean shortestPathsOnly)
Creates an instance for the specified vertex conditions.PathsFinder(VertexCondition startSetCondition, VertexCondition finalSetCondition, boolean shortestPathsOnly, boolean directPathsOnly)
Creates an instance for the specified vertex conditions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AtomicVertex[]
findPaths(AtomicVertex[] graph)
Finds all paths from the specified start vertices to the vertices fullfilling the specified condition.VertexCondition
getFinalSetCondition()
VertexCondition
getStartSetCondition()
boolean
isShortestPathsOnly()
-
-
-
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
- iftrue
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
- iftrue
only the shortest paths are returned.directPathsOnly
- iftrue
only paths of length 1 are returned.
-
-
Method Detail
-
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.
-
-