[![Graph](https://i.stack.imgur.com/sIEFS.png)](https://i.stack.imgur.com/sIEFS.png)

Using a DFS on this graph, the nodes are visited in the following order(for more than one successor node, nodes are pushed to the "frontier" in alphabetical order):

S->A->E->D->F->G

Is that visitation sequence the solution path aswell? If so, why is it not S->A->E->G, since G is also a successor node of E?

PS: Im new to algorithms, so if I'm clearly not understanding the concept, please let me know.