Possible bug in the method for Eulerian paths #312
Labels
bug
Something isn't working
core
something about core
Priority:Medium
Priority Label for medium priority issue
In the
Graph::eulerianPath
method the starting node is chosen as that pointed bynodeSet.begin()
. This works in the test cases, but if we change the order of the nodes then it doesn't work anymore.The starting node for a directed graph in Hierholzer’s Algorithm is the node which has more outgoing links than the others, so I would add this condition for choosing the starting node. For undirected graphs it doesn't make any difference since the choice of the starting node is arbitrary.
Please let me know if you agree or if I am mistaken.
The text was updated successfully, but these errors were encountered: