blob: 35f512be12830a696527ff11cb08023114f50c11 [file] [log] [blame]
tome3489412014-08-29 02:30:38 -07001package org.onlab.graph;
2
3import java.util.List;
4
5/**
6 * Representation of a path in a graph as a sequence of edges. Paths are
7 * assumed to be continuous, where adjacent edges must share a vertex.
8 *
9 * @param <V> vertex type
10 * @param <E> edge type
11 */
12public interface Path<V extends Vertex, E extends Edge<V>> extends Edge<V> {
13
14 /**
15 * Returns the list of edges comprising the path. Adjacent edges will
16 * share the same vertex, meaning that a source of one edge, will be the
17 * same as the destination of the prior edge.
18 *
19 * @return list of path edges
20 */
21 List<E> edges();
22
23 /**
24 * Returns the total cost of the path as a unit-less number.
25 *
26 * @return path cost as a unit-less number
27 */
28 double cost();
29
30}