Interface APSPResult<N,​E>

  • Type Parameters:
    N - node class
    E - edge class
    All Known Implementing Classes:
    FloydWarshallAPSP

    public interface APSPResult<N,​E>
    Result interface for the all pairs shortest paths problem.
    • Method Detail

      • getShortestPathDistance

        float getShortestPathDistance​(N src,
                                      N tgt)
        Retrieves the length of the shortest path between the given nodes.
        Parameters:
        src - the source node
        tgt - the target node
        Returns:
        the length of the shortest path from src to tgt, or Graphs.INVALID_DISTANCE if there exists no such path.
      • getShortestPath

        @Nullable List<E> getShortestPath​(N src,
                                          N tgt)
        Retrieves the shortest path between the given nodes, or null if there exists no such path.
        Parameters:
        src - the source node
        tgt - the target node
        Returns:
        the shortest path from src to tgt, or null if there exists no such path.