Proper traversal of undirected graph using depth first search?
<p>I've got an undirected graph that I need to traverse using depth first search.  </p>

<p>The excel chart below shows each node has been marked after traversal in the marked column, and the edgeTo column shows which node brought us to that node.  For example, we got to node 1 from node 5, we got to node 2 from node 7, etc.</p>

<p>My question is for node 6 and 8, since they are separated from the main graph, how do I properly traverse it?  My guess is that I start at 6 and go to 8, but since 6 will already have been visited at that point, I do not go back to 6 from 8.  Hence row 6 is left blank in the edgeTo column.</p>

<p>Am I correct?  Is my chart correct?</p>

<p><a href="https://i.stack.imgur.com/aRORZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aRORZ.png" alt=""></a></p>

<p><a href="https://i.stack.imgur.com/DF7ql.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DF7ql.png" alt=""></a></p>