MathematicsDiscrete MathematicsMedium

Graph Path

Also known as:Simple PathElementary Path

A path in a graph is a sequence of vertices in which each consecutive pair is connected by an edge and no vertex is repeated. The length of a path is defined as the number of edges it traverses. Paths are central to graph algorithms such as Dijkstra's shortest-path algorithm, breadth-first search, and depth-first search, which are used in navigation systems, network routing, and AI planning.

Key Formula

A path P is a sequence of distinct vertices v₀, v₁, ..., vₖ where each consecutive pair shares an edge

LaTeX: P = v_0, v_1, v_2, \ldots, v_k \text{ where } (v_{i-1}, v_i) \in E \text{ and all } v_i \text{ distinct}

SymbolMeaningUnit
vᵢThe i-th vertex in the path sequencenone
kLength of the path (number of edges)none
EEdge set of the graphnone

Worked Example

Problem

In a graph with vertices {A, B, C, D, E} and edges {AB, BC, CD, DE, AC, BE}, find all simple paths from A to E of length ≤ 3.

Solution

Step 1: List edges: AB, BC, CD, DE, AC, BE. Step 2: Explore paths from A to E (no repeated vertices): Path 1: A → B → E (length 2, uses edges AB, BE) ✓ Path 2: A → C → D → E (length 3, uses AC, CD, DE) ✓ [Wait: is CE an edge? No.] Path 3: A → B → C → D → E (length 4 — exceeds limit, skip) Step 3: Check A → C → ... → E: AC then no direct CE; would need C→D→E (total A→C→D→E = length 3) ✓ Step 4: List valid paths of length ≤ 3: [A,B,E] and [A,C,D,E].

Answer

Two simple paths from A to E of length ≤ 3: A→B→E (length 2) and A→C→D→E (length 3).

Path-Related Concepts in Graph Theory

ConceptDefinitionVertices Repeated?Edges Repeated?
WalkAny sequence of vertices connected by edgesYesYes
TrailWalk with no repeated edgesYesNo
PathWalk with no repeated vertices (or edges)NoNo
CyclePath that starts and ends at the same vertexNo (except endpoints)No
Euler PathTrail that visits every edge exactly onceYesNo
Hamiltonian PathPath that visits every vertex exactly onceNoNo

Interactive Tools

GeoGebra — Graph Path Explorer

Open Tool

Brilliant — Paths in Graphs

Open Tool

Khan Academy — Graph Algorithms

Open Tool
BFS tree illustrating paths discovered from a source vertex in a graph

Wikimedia Commons, CC BY-SA

Related Terms

The word "path" in mathematics retains its everyday English meaning of a route between two points. In graph theory, its precise definition excluding repeated vertices was established in the foundational work of König (Theorie der endlichen und unendlichen Graphen, 1936) and further codified by Berge in the 1950s.

graph-theorytraversalshortest-pathalgorithmsdiscrete-math