Walks, Trails, and Paths
Context: FIT1058_MOC · three increasingly strict ways to traverse a Graph · walk trail path · shortest path defines distance
Quick Revision
- 🎯 Objective: traverse a graph ➔ walk (anything) ⊇ trail (no repeat edge) ⊇ path (no repeat vertex).
- 📦 Core Components: length = edge count ➔ closed if .
- ⚡ Key Constraint: shortest walk = shortest path (defines distance); a path can’t be closed.
📝 Core
1. The Three Levels
- Walk ➔ alternating ; repeats allowed.
- Trail ➔ no repeated edge (vertices may repeat).
- Path ➔ no repeated vertex (hence no repeated edge).
2. Nesting & Length
- path ⊆ trail ⊆ walk ➔ each stricter than the last.
- Length ➔ number of edges; closed if .
- Simple graph ➔ the vertex sequence alone determines a walk.
3. Distance
- Shortest walk = shortest path ➔ delete loops between repeats.
- Distance ➔ length of the shortest path.
Key identities:
⚖️ Core Decision Matrix
| Traversal | Repeat edge? | Repeat vertex? |
|---|---|---|
| walk | allowed | allowed |
| trail | no | allowed |
| path | no | no |
| cycle | no | only endpoints |
When It Flips: whenever a walk from to exists, a path does too (cut the loops) — the basis of Connectivity. A length-0 walk (single vertex) is the reflexive case making connectivity an Equivalence Relation.
📊 Exam Execution Trace
Manual Execution Trace
(), classify sequences:
| Step / State | Sequence | Repeats | Type |
|---|---|---|---|
| 0 (Init) | — | — | — |
| 1 | edge | walk | |
| 2 | vertex (closed) | closed trail (cycle) | |
| 3 | none | path (length 3) |
⚠️ Common Mistakes
- 💡 A path can’t be closed ➔ closing repeats the start vertex; that role belongs to a cycle (closed trail, no interior repeat).
🧠 Active Recall
Define walk, trail, and path, and how they nest.
- Hint: Repetition rules.
Answer
- Short answer: Walk allows all repeats; trail bans edge reuse; path bans vertex reuse; path ⊆ trail ⊆ walk.
- Why: Closed ➔ ; a path can’t be closed.
Why does "shortest walk = shortest path", and how is distance defined?
- Hint: Cut the detours.
Answer
- Short answer: Any walk shortens to a path by deleting the loop between repeated vertices; distance = shortest-path length.
- Why: No repeats in the minimum ➔ so shortest-walk = shortest-path length.