Post numbers in DFS tree of an undirected graph
You conclusion is correct.

Here is (the sketch of) a proof.


If pre($u$) &lt; pre($v$), the search must discover and finish $v$ before it finishes $u$, since $v$ is on $u$’s adjacency list. That is, post($v$) &lt; post($u$) and $v$ is in the subtree rooted at $u$.
If pre($v$) &lt; pre($u$), the search must discover and finish $u$ before it finishes $v$, since $u$ is on $v$’s adjacency list. That is, post($u$) &lt; post($v$) and $u$ is in the subtree rooted at $v$.