A walk from vertex to vertex in a graph is an alternating sequence of vertices and rows where the edge is between the vertices and . A walk is said to be closed when the begin- and endpoint are the same. A closed walk is called a circuit.
A path is a walk in which no vertex is visited twice except maybe the begin- and endpoint. A closed path is called a cycle.
The length of a walk or path is the number of edges in respectivly the walk or the path.
The distance between two vertices in a graph is the length of the shortest path between those two vertices. When the two vertices are located in different components of the graph, we take the distance to be infinite.