Hierholzer's algorithm

ID: hierholzer-s-algorithm

Hierholzer's algorithm constructs an Euler circuit by growing closed trails along unused edges and splicing them at shared vertices, as in the Euler circuit criterion. Each edge must have a distinct record. An implementation using adjacency lists, a stack, and a used flag for each edge runs in time, including the connectivity and vertex degree checks. Store both incidences of a self-loop, while marking its single edge record used only once.

New to topics? Read the docs here!