Algorithm for Finding Eulerian Paths (Python)

Udacity has excellent courses on computer science. I’m now taking my third course, Algorithms (CS215). One of the assignments of this course asked students to write a script that would find an Eulerian path in a given graph.

This topic greatly interests, so I’ve decided to research more about it. There are several solutions to the problem; I’ve implemented one based on Hierholzer’s algorithm, with some modifications to also support graphs with two nodes of odd degree. The script below successfully solved the assignment’s problem. I’ve also added comments to make it clearer.

 

This entry was posted in Programming. Bookmark the permalink.

Leave a Reply