| 1 | Start DFS at node 0 | 0 | - | [0,0,0,0,0] | [0,0,0,0,0] | [] | Graph: 0--1--2--3--4
All nodes unvisited |
| 2 | Set discovery[0] and low[0] | 0 | - | [1,0,0,0,0] | [1,0,0,0,0] | [] | Node 0 visited, disc=1, low=1 |
| 3 | Visit neighbor 1 of 0 | 0 | 1 | [1,0,0,0,0] | [1,0,0,0,0] | [] | Edge 0-1 explored |
| 4 | Neighbor 1 not visited, DFS(1) | 1 | - | [1,0,0,0,0] | [1,0,0,0,0] | [] | Go deeper to node 1 |
| 5 | Set discovery[1] and low[1] | 1 | - | [1,2,0,0,0] | [1,2,0,0,0] | [] | Node 1 visited, disc=2, low=2 |
| 6 | Visit neighbor 0 of 1 | 1 | 0 | [1,2,0,0,0] | [1,2,0,0,0] | [] | Neighbor 0 is parent, skip |
| 7 | Visit neighbor 2 of 1 | 1 | 2 | [1,2,0,0,0] | [1,2,0,0,0] | [] | Edge 1-2 explored |
| 8 | Neighbor 2 not visited, DFS(2) | 2 | - | [1,2,0,0,0] | [1,2,0,0,0] | [] | Go deeper to node 2 |
| 9 | Set discovery[2] and low[2] | 2 | - | [1,2,3,0,0] | [1,2,3,0,0] | [] | Node 2 visited, disc=3, low=3 |
| 10 | Visit neighbor 1 of 2 | 2 | 1 | [1,2,3,0,0] | [1,2,3,0,0] | [] | Neighbor 1 is parent, skip |
| 11 | Visit neighbor 3 of 2 | 2 | 3 | [1,2,3,0,0] | [1,2,3,0,0] | [] | Edge 2-3 explored |
| 12 | Neighbor 3 not visited, DFS(3) | 3 | - | [1,2,3,0,0] | [1,2,3,0,0] | [] | Go deeper to node 3 |
| 13 | Set discovery[3] and low[3] | 3 | - | [1,2,3,4,0] | [1,2,3,4,0] | [] | Node 3 visited, disc=4, low=4 |
| 14 | Visit neighbor 2 of 3 | 3 | 2 | [1,2,3,4,0] | [1,2,3,4,0] | [] | Neighbor 2 is parent, skip |
| 15 | Visit neighbor 4 of 3 | 3 | 4 | [1,2,3,4,0] | [1,2,3,4,0] | [] | Edge 3-4 explored |
| 16 | Neighbor 4 not visited, DFS(4) | 4 | - | [1,2,3,4,0] | [1,2,3,4,0] | [] | Go deeper to node 4 |
| 17 | Set discovery[4] and low[4] | 4 | - | [1,2,3,4,5] | [1,2,3,4,5] | [] | Node 4 visited, disc=5, low=5 |
| 18 | Visit neighbor 3 of 4 | 4 | 3 | [1,2,3,4,5] | [1,2,3,4,5] | [] | Neighbor 3 is parent, skip |
| 19 | End DFS at 4, back to 3 | 3 | - | [1,2,3,4,5] | [1,2,3,4,5] | [] | Update low[3] = min(4,5) = 4 |
| 20 | Check if low[4] > disc[3] | 3 | 4 | [1,2,3,4,5] | [1,2,3,4,5] | [(3,4)] | Bridge found: edge 3-4 |
| 21 | End DFS at 3, back to 2 | 2 | - | [1,2,3,4,5] | [1,2,3,4,5] | [(3,4)] | Update low[2] = min(3,4) = 3 |
| 22 | Check if low[3] > disc[2] | 2 | 3 | [1,2,3,4,5] | [1,2,3,4,5] | [(3,4),(2,3)] | Bridge found: edge 2-3 |
| 23 | End DFS at 2, back to 1 | 1 | - | [1,2,3,4,5] | [1,2,3,4,5] | [(3,4),(2,3)] | Update low[1] = min(2,3) = 2 |
| 24 | Check if low[2] > disc[1] | 1 | 2 | [1,2,3,4,5] | [1,2,3,4,5] | [(3,4),(2,3),(1,2)] | Bridge found: edge 1-2 |
| 25 | End DFS at 1, back to 0 | 0 | - | [1,2,3,4,5] | [1,2,3,4,5] | [(3,4),(2,3),(1,2)] | Update low[0] = min(1,2) = 1 |
| 26 | Check if low[1] > disc[0] | 0 | 1 | [1,2,3,4,5] | [1,2,3,4,5] | [(3,4),(2,3),(1,2),(0,1)] | Bridge found: edge 0-1 |
| 27 | DFS complete for all nodes | - | - | [1,2,3,4,5] | [1,2,3,4,5] | [(3,4),(2,3),(1,2),(0,1)] | All nodes visited, bridges found: (3,4), (2,3), (1,2), (0,1) |
| 28 | Termination | - | - | - | - | [(3,4),(2,3),(1,2),(0,1)] | No more nodes to visit |