Interface VertexSequenceFinder<V,C extends Number & Comparable<C>>

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

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

    • findVertexSequence

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

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

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

      default @Nullable OrderedPair<ImmutableList<V>,C> findVertexSequence(@NonNull V start, @NonNull Predicate<V> goalPredicate, int maxDepth, @NonNull C costLimit, @NonNull AddToSet<V> visited)
      Finds a vertex sequence from a start vertex to a vertex that satisfies the goal predicate.
      Parameters:
      start - the start vertex
      goalPredicate - 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 (vertex sequence, cost), or null if no sequence was found.
    • findVertexSequence

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

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

      default @Nullable SimpleOrderedPair<ImmutableList<V>,C> findVertexSequence(@NonNull V start, @NonNull V goal, int maxDepth, @NonNull C costLimit, @NonNull AddToSet<V> visited)
      Finds a vertex 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 (vertex sequence, cost), or null if no sequence was found.
    • findVertexSequence

      default @Nullable SimpleOrderedPair<ImmutableList<V>,C> findVertexSequence(@NonNull V start, @NonNull V goal, int maxDepth, @NonNull C costLimit)
      Finds a vertex 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 (vertex sequence, cost), or null if no sequence was found.
    • findVertexSequence

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

      @Nullable SimpleOrderedPair<ImmutableList<V>,C> findVertexSequenceOverWaypoints(@NonNull Iterable<V> waypoints, int maxDepth, @NonNull C costLimit, @NonNull Supplier<AddToSet<V>> visitedSetFactory)
      Finds a vertex 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 (vertex sequence, cost), or null if no sequence was found.
    • findVertexSequenceOverWaypoints

      default @Nullable SimpleOrderedPair<ImmutableList<V>,C> findVertexSequenceOverWaypoints(@NonNull Iterable<V> waypoints, int maxDepth, @NonNull C costLimit)
      Finds a vertex 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 (vertex sequence, cost), or null if no sequence was found.
    • findVertexSequenceOverWaypoints

      default @Nullable SimpleOrderedPair<ImmutableList<V>,C> findVertexSequenceOverWaypoints(@NonNull Iterable<V> waypoints, @NonNull C costLimit)
      Finds a vertex 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 (vertex sequence, cost), or null if no sequence was found.
    • findVertexSequenceOverWaypoints

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