Skip to content

Possible bug in the method for Eulerian paths #312

@sbaldu

Description

@sbaldu

In the Graph::eulerianPath method the starting node is chosen as that pointed by nodeSet.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.

Metadata

Metadata

Assignees

Labels

Priority:MediumPriority Label for medium priority issuebugSomething isn't workingcoresomething about core

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions