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

TraversalRepeat edge?Repeat vertex?
walkallowedallowed
trailnoallowed
pathnono
cyclenoonly 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 / StateSequenceRepeatsType
0 (Init)
1edge walk
2vertex (closed)closed trail (cycle)
3nonepath (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