Interface ShortestPathResult

  • All Known Subinterfaces:
    MinMaxPathResult
    All Known Implementing Classes:
    MinMaxPathResultImpl, ShortestPathResultImpl

    public interface ShortestPathResult
    Interfaces that defines how to access results of a shortest path execution allowing one to extract paths or cost information
    Author:
    markr
    • Method Detail

      • createPath

        DirectedPath createPath​(DirectedPathFactory pathFactory,
                                Vertex origin,
                                Vertex destination)
        Create the path from the provided origin to a specified destination vertex, using the results available. The path builder is used to create the instance of the path.
        Parameters:
        pathFactory - to use for creating path instances
        origin - the specified origin vertex
        destination - the specified destination vertex
        Returns:
        the path that is created, when no path could be extracted null is returned
      • forEachBackwardEdgeSegment

        default int forEachBackwardEdgeSegment​(Vertex origin,
                                               Vertex destination,
                                               Consumer<EdgeSegment> backwardEdgeSegmentConsumer)
        apply consumer to each edge segment on backward path from destination to origin. If path does not lead to origin, the loop terminates when no backward edge segment is found anymore
        Parameters:
        origin - to end loop
        destination - to start backward loop
        backwardEdgeSegmentConsumer - to apply to each segment on the backward path from destination to origin
        Returns:
        number of edge segments traversed on the path
      • getIncomingEdgeSegmentForVertex

        EdgeSegment getIncomingEdgeSegmentForVertex​(Vertex vertex)
        Find the incoming edge segment for a given vertex
        Parameters:
        vertex - to get incoming segment for
        Returns:
        incoming edge segment
      • getCostToReach

        double getCostToReach​(Vertex vertex)
        Collect the cost to reach the given vertex
        Parameters:
        vertex - to collect cost for
        Returns:
        cost found