Walks, Trails, Paths, Cycles and Circuits in Graph Practice Questions

Last Updated : 10 Jul, 2026

Walks, Trails, Paths, Cycles, and Circuits are different ways of moving through a graph by following its vertices and edges. They differ in whether vertices or edges can be repeated and are used to analyze routes, networks, and graph structures.

Example:

In a road network, a walk may revisit roads and places, a trail does not repeat any road, a path does not repeat any place, and a cycle (or circuit) starts and ends at the same vertex.

Question 1. Find a trail from A to D for below graph below

A - B

| |

C - D

One possible trail is: A → B → D.

Question 2. Find the shortest path from A to C.

A - B - C

| |

D - E

The shortest path is: A → B → C.

Question 3. Finding All Possible Paths

A - B - C

| |

D - E

The path is : A → B → C

Practice Problems

Graph for Reference:

A
/ | \
B C D
\ | /
E
|
F

  1. Find a path from A to F.
  2. Find a simple path from B to F.
  3. Find a trail that uses every edge exactly once.
  4. Identify a cycle in the graph.
  5. Find the shortest path from A to E.
  6. List all possible paths from E to F.
  7. Find a trail from C to F.
  8. Find the longest simple path in the graph.
  9. Count the number of distinct cycles in the graph.
  10. Find a path from A to F that consists of exactly 3 edges.
Comment

Explore