Module org.jhotdraw8.graph
Package org.jhotdraw8.graph.path.algo
Interface IndexedVertexReachabilityAlgo<C extends Number & Comparable<C>>
- Type Parameters:
C- the cost number type
- All Known Implementing Classes:
AnyIndexedVertexReachabilityAlgo
public interface IndexedVertexReachabilityAlgo<C extends Number & Comparable<C>>
Interface for a reachability checker algorithm over a directed graph.
-
Method Summary
Modifier and TypeMethodDescriptionbooleantryToReach(@NonNull Iterable<Integer> startVertices, @NonNull IntPredicate goalPredicate, @NonNull Function<Integer, Spliterator.OfInt> nextVerticesFunction, int maxDepth, @NonNull C zero, @NonNull C costLimit, @NonNull BiFunction<Integer, Integer, C> costFunction, @NonNull BiFunction<C, C, C> sumFunction, @NonNull AddToIntSet visited) Search engine method.
-
Method Details
-
tryToReach
boolean tryToReach(@NonNull Iterable<Integer> startVertices, @NonNull IntPredicate goalPredicate, @NonNull Function<Integer, Spliterator.OfInt> nextVerticesFunction, int maxDepth, @NonNull C zero, @NonNull C costLimit, @NonNull BiFunction<Integer, Integer, C> costFunction, @NonNull BiFunction<C, C, C> sumFunction, @NonNull AddToIntSet visited) Search engine method.- Parameters:
startVertices- the set of start verticesgoalPredicate- the goal predicatenextVerticesFunction- the next vertices functionmaxDepth- the maximal depth (inclusive) of the search Must be >= 0.zero- the zero cost valuecostLimit- the algorithm-specific cost limitcostFunction- the cost functionsumFunction- the sum function for adding two cost valuesvisited- the visited function- Returns:
- true on success
-