Recursive depth-first search from 0. Each call is one vertex: it marks itself seen, dives into its first unseen neighbour, and only returns when that whole branch is done. The path label is the call stack, and it grows on the way down and shrinks on backtracking.
Recursive DFS from 0 over 7 vertices.
Call dfs(0): mark it seen, visit number 1. Neighbours 1, 2. 1 is unseen, so the call dives into it before looking at the rest.
Enter 0, depth 1.
Call dfs(1): mark it seen, visit number 2. Neighbours 0, 3, 4. 3 is unseen, so the call dives into it before looking at the rest.
Enter 1, depth 2.
Call dfs(3): mark it seen, visit number 3. Neighbours 1. All of them are seen already, so this call returns straight away.
Enter 3, depth 3.
dfs(3) returned, so control is back in dfs(1) at depth 2. Next unseen neighbour: 4.
Back in 1.
Call dfs(4): mark it seen, visit number 4. Neighbours 1, 6. 6 is unseen, so the call dives into it before looking at the rest.
Enter 4, depth 3.
Call dfs(6): mark it seen, visit number 5. Neighbours 4. All of them are seen already, so this call returns straight away.
Enter 6, depth 4.
dfs(6) returned, so control is back in dfs(4) at depth 3. No unseen neighbour is left, so dfs(4) will return too.
Back in 4.
dfs(4) returned, so control is back in dfs(1) at depth 2. No unseen neighbour is left, so dfs(1) will return too.
Back in 1.
dfs(1) returned, so control is back in dfs(0) at depth 1. Next unseen neighbour: 2.
Back in 0.
Call dfs(2): mark it seen, visit number 6. Neighbours 0, 5. 5 is unseen, so the call dives into it before looking at the rest.
Enter 2, depth 2.
Call dfs(5): mark it seen, visit number 7. Neighbours 2. All of them are seen already, so this call returns straight away.
Enter 5, depth 3.
dfs(5) returned, so control is back in dfs(2) at depth 2. No unseen neighbour is left, so dfs(2) will return too.
Back in 2.
dfs(2) returned, so control is back in dfs(0) at depth 1. No unseen neighbour is left, so dfs(0) will return too.
Back in 0.
Visit order 0, 1, 3, 4, 6, 2, 5: 7 of 7 vertices reachable from 0. Every vertex was entered once and every edge looked at twice, O(V + E), and the deepest call stack was as long as the longest path taken, which is what can overflow on a huge graph.
Visited 7 vertices.