A path in a multigraph G consists of an alternating sequence of vertices and edges of the form
v0, e1, v1, e2, v2, . . . , en?1,vn?1,en, vn
where each edge eicontains the vertices vi?1andvi(which appear on the sides of eiin the sequence). The
number n of edges is called the length of the path. When there is no ambiguity, we denote a path by its sequence
of vertices (v0, v1, . . . , vn). The path is said to be closed if v0= vn. Otherwise, we say the path is from v0, to vn
or between v0and vn, or connects v0to vn.
A simple path is a path in which all vertices are distinct. (A path in which all edges are distinct will be called
a trail.) A cycle is a closed path of length 3 or more in which all vertices are distinct except v0= vn. A cycle of
length k is called a k-cycle.
EXAMPLE 8.1 Consider the graph G in Fig. 8-8(a). Consider the following sequences:
? = (P4, P1, P2, P5, P1, P2, P3, P6), ? = (P4, P1, P5, P2, P6),
? = (P4, P1, P5, P2, P3, P5, P6),
? = (P4, P1, P5, P3, P6).