# Path (graph theory)

In mathematics, a path in a graph is a sequence of vertices such that from each of its vertices there is an edge to the successor vertex. The first vertex is called start vertex and the last vertex is called end vertex. Both of them are called end or terminal vertices of the path. The other vertices in the path are internal vertices.

A path is called a simple path if none of the vertices in the path are repeated.

Missing image
Directed_cycle.png
A directed cycle. Without the arrows, it is just a cycle. This is not a simple cycle, since the blue vertices are used twice.

A cycle is the sequence of vertices that forms a path and additionally the end vertex of the path is connected with the start one. Informally, a path is called a cycle if its start vertex is also its end vertex. Notice however that unlike paths, cycles do not have natural start/end vertices.

A cycle with no repeated vertices is called a simple cycle.

Sometimes it is important to distinguish a cycle and paths that coincide with the cycle, produced by ignoring a single connection of the cycle. In such situations and in some others a path is defined as alternating sequence of vertices and edges that begins and ends with a vertex, such that every edge connects the two vertices that precede and follow it in the sequence. A cycle is then defined as a path with an extra edge that connects the first and the last vertices of the path.

Two paths are independent (alternatively, internally vertex-disjoint) if they do not have any internal vertex in common.

The length of a path is the number of edges that the path uses, counting multiple edges multiple times. In the graph shown, (1, 2, 5, 1, 2, 3) is a path of length 5, and (5, 2, 1) is a simple path of length 2.

A weighted graph associates a value (weight) with every edge in the graph. The weight of a path in a weighted graph is the sum of the weights of the traversed edges. Sometimes the words cost or length are used instead of weight.

• Art and Cultures
• Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
• Space and Astronomy