Module org.jhotdraw8.graph
Package org.jhotdraw8.graph.path
Interface ReachabilityChecker<V,C extends Number & Comparable<C>>
- Type Parameters:
V- the vertex data typeC- the cost number type
- All Known Implementing Classes:
SimpleReachabilityChecker
public interface ReachabilityChecker<V,C extends Number & Comparable<C>>
Interface for checking if there is a vertex sequence
up to (inclusive) a maximal cost in a directed graph.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanisReachable(@NonNull V start, @NonNull V goal, int maxDepth, @NonNull C costLimit, @NonNull AddToSet<V> visited) Checks if a vertex sequence from start to goal exists.booleanisReachable(@NonNull V start, @NonNull Predicate<V> goalPredicate, int maxDepth, @NonNull C costLimit, @NonNull AddToSet<V> visited) Checks if a vertex sequence from a start vertex to a vertex that satisfies the goal predicate exists.booleanisReachable(@NonNull Iterable<V> startVertices, @NonNull Predicate<V> goalPredicate, int maxDepth, @NonNull C costLimit, @NonNull AddToSet<V> visited) Checks if a vertex sequence from a set of start vertices to a vertex that satisfies the goal predicate exists.
-
Method Details
-
isReachable
boolean isReachable(@NonNull Iterable<V> startVertices, @NonNull Predicate<V> goalPredicate, int maxDepth, @NonNull C costLimit, @NonNull AddToSet<V> visited) Checks if a vertex sequence from a set of start vertices to a vertex that satisfies the goal predicate exists.- Parameters:
startVertices- the start verticesgoalPredicate- the goal vertexmaxDepth- the maximal depth (inclusive) of the search Must be >= 0.costLimit- the algorithm-specific cost limitvisited- the visited function- Returns:
- true if a sequence was found.
-
isReachable
boolean isReachable(@NonNull V start, @NonNull Predicate<V> goalPredicate, int maxDepth, @NonNull C costLimit, @NonNull AddToSet<V> visited) Checks if a vertex sequence from a start vertex to a vertex that satisfies the goal predicate exists.- Parameters:
start- the start vertexgoalPredicate- the goal vertexmaxDepth- the maximal depth (inclusive) of the search Must be >= 0.costLimit- the algorithm-specific cost limitvisited- the visited function- Returns:
- true if a sequence was found.
-
isReachable
boolean isReachable(@NonNull V start, @NonNull V goal, int maxDepth, @NonNull C costLimit, @NonNull AddToSet<V> visited) Checks if a vertex sequence from start to goal exists.- Parameters:
start- the start vertexgoal- the goal vertexmaxDepth- the maximal depth (inclusive) of the search Must be >= 0.costLimit- the algorithm-specific cost limitvisited- the visited function- Returns:
- true if a sequence was found.
-