A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Walks, Trails, Paths, and Cycles in Graphs

College Depth 83 in the knowledge graph ☐ I know this ☆ Set as goal
10topics build on this
401prerequisites beneath it
See this on the map →
Connectivity and Connected ComponentsChromatic Polynomial and Counting Proper Colorings+1 more→→Eulerian Paths, Circuits, and CharacterizationHamiltonian Paths, Cycles, and NP-Completeness
graph-theory walks-paths

Core Idea

A walk is a sequence of vertices where consecutive vertices are connected by edges. A trail is a walk with distinct edges. A path is a walk with distinct vertices. A cycle is a closed walk with no repeated vertices (except first and last). These distinctions are fundamental in analyzing graph structure.

Explainer

From your study of graph connectivity, you know that two vertices are connected when you can get from one to the other by following edges. But "getting from one to the other" can mean many different things depending on what you're allowed to revisit. The vocabulary of walks, trails, paths, and cycles draws these distinctions precisely, and the differences matter enormously for the theorems that follow.

A walk is the most permissive: a sequence of vertices v₀, v₁, …, vₖ where each consecutive pair is adjacent. Nothing is forbidden — you may traverse the same edge multiple times, visit the same vertex multiple times, anything goes. A trail adds one restriction: all edges must be distinct. You can still revisit a vertex, but you cannot travel the same edge twice. Think of a trail as "the roads I've driven with no repeated roads." A path is stricter still: all vertices must be distinct (which automatically means all edges are distinct too, since revisiting a vertex would require revisiting an incident edge or a self-loop). A path is the "road trip where I never enter the same city twice."

A cycle is a closed path: you start and end at the same vertex, and all intermediate vertices are distinct. A closed trail (returning to start with no repeated edges but possibly repeated vertices) is called an Eulerian circuit, which is the subject of the next topic in your graph theory sequence. The hierarchy is clean: every path is a trail, every trail is a walk, but not every walk is a trail and not every trail is a path.

Why do these distinctions matter? Many graph problems are stated as: "does there exist a walk/trail/path of type X?" and the answer can be radically different for each type. A graph has an Eulerian trail (traversing every edge exactly once) if and only if it has exactly 0 or 2 vertices of odd degree — a beautiful theorem that depends entirely on the "no repeated edges" requirement. By contrast, finding a Hamiltonian path (visiting every vertex exactly once) is NP-complete in general — a structurally similar question that is computationally intractable. The distinction between these two classical problems is precisely the distinction between trails and paths: same spirit, wildly different difficulty. Getting the vocabulary right is the prerequisite to stating these theorems precisely.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Set Operations: Union, Intersection, and Complement → Proof by Cases → Proving by Cases and Exhaustion → Vacuous Truth and Trivial Cases → Proof by Cases (Proof by Exhaustion) → Mathematical Induction → Graph Paths, Cycles, and Connectivity → Trees and Spanning Trees → Planar Graphs and Euler's Formula → Graph Coloring and the Chromatic Number → Graph Coloring and Chromatic Numbers → Bipartite Graphs and Matching Problems → Bipartite Graphs and 2-Colorability → Graph Matching and Hall's Marriage Theorem → Network Flows: Maximum Flow and Minimum Cut → Walks, Trails, Paths, and Cycles in Graphs

Longest path: 84 steps · 401 total prerequisite topics

Prerequisites (3)

Leads To (2)