Interface ArrowSequenceFinder<V,A,C extends Number & Comparable<C>>

Type Parameters:
V - the vertex data type
A - the arrow data type
C - the cost number type
All Known Subinterfaces:
CombinedSequenceFinder<V,A,C>
All Known Implementing Classes:
SimpleCombinedSequenceFinder

public interface ArrowSequenceFinder<V,A,C extends Number & Comparable<C>>
Interface for finding arrow sequences up to (inclusive) a maximal cost in a directed graph.
  • Method Details

    • findArrowSequence

      @Nullable SimpleOrderedPair<ImmutableList<A>,C> findArrowSequence(@NonNull Iterable<V> startVertices, @NonNull Predicate<V> goalPredicate, int maxDepth, @NonNull C costLimit, @NonNull AddToSet<V> visited)
      Finds an arrow sequence from a set of start vertices to a vertex that satisfies the goal predicate.
      Parameters:
      startVertices - the start vertex
      goalPredicate - the goal predicate
      maxDepth - the maximal depth (inclusive) of the search Must be >= 0.
      costLimit - the algorithm-specific cost limit
      visited - the visited function
      Returns:
      an ordered pair (arrow sequence, cost), or null if no sequence was found.
    • findArrowSequence

      default @Nullable SimpleOrderedPair<ImmutableList<A>,C> findArrowSequence(@NonNull Iterable<V> startVertices, @NonNull Predicate<V> goalPredicate, int maxDepth, @NonNull C costLimit)
      Finds an arrow sequence from a set of start vertices to a vertex that satisfies the goal predicate.
      Parameters:
      startVertices - the start vertex
      goalPredicate - the goal predicate
      maxDepth - the maximal depth (inclusive) of the search Must be >= 0.
      costLimit - the algorithm-specific cost limit
      Returns:
      an ordered pair (arrow sequence, cost), or null if no sequence was found.
    • findArrowSequence

      default @Nullable SimpleOrderedPair<ImmutableList<A>,C> findArrowSequence(@NonNull Iterable<V> startVertices, @NonNull Predicate<V> goalPredicate, @NonNull C costLimit)
      Finds an arrow sequence from a set of start vertices to a vertex that satisfies the goal predicate.
      Parameters:
      startVertices - the start vertex
      goalPredicate - the goal predicate
      costLimit - the algorithm-specific cost limit
      Returns:
      an ordered pair (arrow sequence, cost), or null if no sequence was found.
    • findArrowSequence

      default @Nullable OrderedPair<ImmutableList<A>,C> findArrowSequence(@NonNull V start, @NonNull V goal, int maxDepth, @NonNull C costLimit, @NonNull AddToSet<V> visited)
      Finds an arrow sequence from start to goal.
      Parameters:
      start - the start vertex
      goal - the goal vertex
      maxDepth - the maximal depth (inclusive) of the search Must be >= 0.
      costLimit - the algorithm-specific cost limit
      visited - the visited function
      Returns:
      an ordered pair (arrow sequence, cost), or null if no sequence was found.
    • findArrowSequence

      default @Nullable SimpleOrderedPair<ImmutableList<A>,C> findArrowSequence(@NonNull V start, @NonNull V goal, int maxDepth, @NonNull C costLimit)
      Finds an arrow sequence from start to goal.
      Parameters:
      start - the start vertex
      goal - the goal vertex
      maxDepth - the maximal depth (inclusive) of the search Must be >= 0.
      costLimit - the algorithm-specific cost limit
      Returns:
      an ordered pair (arrow sequence, cost), or null if no sequence was found.
    • findArrowSequence

      default @Nullable SimpleOrderedPair<ImmutableList<A>,C> findArrowSequence(@NonNull V start, @NonNull V goal, @NonNull C costLimit)
      Finds an arrow sequence from start to goal.
      Parameters:
      start - the start vertex
      goal - the goal vertex
      costLimit - the algorithm-specific cost limit
      Returns:
      an ordered pair (arrow sequence, cost), or null if no sequence was found.
    • findArrowSequenceOverWaypoints

      @Nullable SimpleOrderedPair<ImmutableList<A>,C> findArrowSequenceOverWaypoints(@NonNull Iterable<V> waypoints, int maxDepth, @NonNull C costLimit, @NonNull Supplier<AddToSet<V>> visitedSetFactory)
      Finds an arrow sequence through the given waypoints.
      Parameters:
      waypoints - a list of waypoints
      maxDepth - the maximal depth (inclusive) of the search Must be >= 0.
      costLimit - the algorithm-specific cost limit for paths between waypoints
      visitedSetFactory - the visited set factory
      Returns:
      an ordered pair (arrow sequence, cost), or null if no sequence was found.
    • findArrowSequenceOverWaypoints

      default @Nullable SimpleOrderedPair<ImmutableList<A>,C> findArrowSequenceOverWaypoints(@NonNull Iterable<V> waypoints, int maxDepth, @NonNull C costLimit)
      Finds an arrow sequence through the given waypoints.
      Parameters:
      waypoints - a list of waypoints
      maxDepth - the maximal depth (inclusive) of the search Must be >= 0.
      costLimit - the algorithm-specific cost limit for paths between waypoints
      Returns:
      an ordered pair (arrow sequence, cost), or null if no sequence was found.
    • findArrowSequenceOverWaypoints

      default @Nullable SimpleOrderedPair<ImmutableList<A>,C> findArrowSequenceOverWaypoints(@NonNull Iterable<V> waypoints, @NonNull C costLimit)
      Finds an arrow sequence through the given waypoints.
      Parameters:
      waypoints - a list of waypoints
      costLimit - the algorithm-specific cost limit for paths between waypoints
      Returns:
      an ordered pair (arrow sequence, cost), or null if no sequence was found.
    • findArrowSequenceOverWaypoints

      static <VV, AA, CC extends Number & Comparable<CC>> @Nullable SimpleOrderedPair<ImmutableList<AA>,CC> findArrowSequenceOverWaypoints(@NonNull Iterable<VV> waypoints, @NonNull BiFunction<VV,VV,OrderedPair<ImmutableList<AA>,CC>> findArrowSequenceFunction, @NonNull CC zero, @NonNull BiFunction<CC,CC,CC> sumFunction)
      Type Parameters:
      VV - the vertex type
      CC - the number type
      Parameters:
      waypoints - the waypoints
      findArrowSequenceFunction - the search function, for example this::findArrowSequence
      zero - the zero value
      sumFunction - the sum function
      Returns:
      an ordered pair with the combined sequence