Interface Path<V extends Vertex,​E extends Edge<V>>

  • Type Parameters:
    V - vertex type
    E - edge type
    All Superinterfaces:
    Edge<V>
    All Known Subinterfaces:
    MutablePath<V,​E>
    All Known Implementing Classes:
    DefaultMutablePath, DefaultPath, DisjointPathPair

    public interface Path<V extends Vertex,​E extends Edge<V>>
    extends Edge<V>
    Representation of a path in a graph as a sequence of edges. Paths are assumed to be continuous, where adjacent edges must share a vertex.
    • Method Detail

      • edges

        List<E> edges()
        Returns the list of edges comprising the path. Adjacent edges will share the same vertex, meaning that a source of one edge, will be the same as the destination of the prior edge.
        Returns:
        list of path edges
      • cost

        Weight cost()
        Returns the total cost of the path as a weight object.
        Returns:
        path cost as a weight object