I have found multiple algorithms that allows determining the back edges of a directed graph using DFS. Unfortunately, I found an inconsistency in one of the graphs I am analyzing. Please find below a minimal example:
For this directed graph, I expected the algorithms to determine only one back edge that is the one I marked in red: E->B
.
Instead, differently from my understanding, the algorithms can determine as a back edge also edge B->E
. The different results depend on the graph's traversals, for instance:
Traversal | Back Edge
-------------------------
A->B->D->E | E->B
A->C->D->E->B | B->E
Q1: Is it correct assuming that the graph's back edge is only E->B
?
Q2: If so, which algorithm can guarantee the correct DFS traversal?