Package org.jgrapht

Interface GraphPath<V,​E>

  • All Known Implementing Classes:
    GraphPathImpl

    public interface GraphPath<V,​E>
    A GraphPath represents a path in a Graph. Note that a path is defined primarily in terms of edges (rather than vertices) so that multiple edges between the same pair of vertices can be discriminated.
    Since:
    Jan 1, 2008
    Author:
    John Sichi
    • Method Detail

      • getGraph

        Graph<V,​E> getGraph()
        Returns the graph over which this path is defined. The path may also be valid with respect to other graphs.
        Returns:
        the containing graph
      • getStartVertex

        V getStartVertex()
        Returns the start vertex in the path.
        Returns:
        the start vertex
      • getEndVertex

        V getEndVertex()
        Returns the end vertex in the path.
        Returns:
        the end vertex
      • getEdgeList

        java.util.List<E> getEdgeList()
        Returns the edges making up the path. The first edge in this path is incident to the start vertex. The last edge is incident to the end vertex. The vertices along the path can be obtained by traversing from the start vertex, finding its opposite across the first edge, and then doing the same successively across subsequent edges; Graphs.getPathVertexList(org.jgrapht.GraphPath<V, E>) provides a convenience method for this.

        Whether or not the returned edge list is modifiable depends on the path implementation.

        Returns:
        list of edges traversed by the path
      • getWeight

        double getWeight()
        Returns the weight assigned to the path. Typically, this will be the sum of the weights of the edge list entries (as defined by the containing graph), but some path implementations may use other definitions.
        Returns:
        the weight of the path