Interface ShortestPath<V>

  • Type Parameters:
    V - the vertex type parameter
    All Known Implementing Classes:
    DijkstraShortestPath

    public interface ShortestPath<V>
    Calculates the shortest path between two vertices.
    Author:
    David B. Bracewell
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      double distance​(V source, V target)
      The distance between the two vertices.
      List<Edge<V>> path​(V source, V target)
      The shortest path (list of edges) from the source to target vertex.
    • Method Detail

      • distance

        double distance​(V source,
                        V target)
        The distance between the two vertices.
        Parameters:
        source - the starting (source) vertex
        target - the target vertex
        Returns:
        the distance from source to target (Positive Infinity if no path exists).
      • path

        List<Edge<V>> path​(V source,
                           V target)
        The shortest path (list of edges) from the source to target vertex.
        Parameters:
        source - the starting (source) vertex
        target - the target vertex
        Returns:
        List of edges from source to target representing the shortest path.