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 moreEulerian 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 ZeroThe Number ZeroCounting to FiveCounting to 10Counting to 20Counting a Set of Objects Up to 20Cardinality: The Last Number CountedMatching Numerals to QuantitiesSubitizing Small QuantitiesAddition Within 10Number Bonds to 10Addition Within 20Doubles and Near DoublesDoubles Facts Within 10Near Doubles Facts Within 20Mental Math Strategies for AdditionMental Math: Adding and Subtracting TensAddition Within 100Repeated Addition as MultiplicationMultiplication as Equal GroupsMultiplication: ArraysBasic Multiplication Facts (0s, 1s, 2s, 5s, 10s)Multiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Multiplication and Division Fact FamiliesRelationship Between Multiplication and DivisionDivision Facts as Inverse of MultiplicationRemainders and Quotients in DivisionDivision Word ProblemsMulti-Step Word ProblemsSolving Multi-Step Word ProblemsMultiplication Word ProblemsDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueIntegers and the Number LineComparing and Ordering IntegersAbsolute ValueAdding IntegersSubtracting IntegersMultiplying IntegersIntroduction to ExponentsOrder of OperationsInteger Order of OperationsVariable ExpressionsThe Distributive PropertyVariables and Expressions ReviewIntroduction to PolynomialsAdding and Subtracting PolynomialsMultiplying PolynomialsFactorialPermutationsCombinationsCounting Principles: Addition and Multiplication RulesIntroduction to Graph TheoryPropositional Logic FoundationsLogical EquivalencesSet Operations: Union, Intersection, and ComplementProof by CasesProving by Cases and ExhaustionVacuous Truth and Trivial CasesProof by Cases (Proof by Exhaustion)Mathematical InductionGraph Paths, Cycles, and ConnectivityTrees and Spanning TreesPlanar Graphs and Euler's FormulaGraph Coloring and the Chromatic NumberGraph Coloring and Chromatic NumbersBipartite Graphs and Matching ProblemsBipartite Graphs and 2-ColorabilityGraph Matching and Hall's Marriage TheoremNetwork Flows: Maximum Flow and Minimum CutWalks, Trails, Paths, and Cycles in Graphs

Longest path: 84 steps · 401 total prerequisite topics

Prerequisites (3)

Leads To (2)