Euler trail through every edge

Check whether an undirected graph admits a trail using each edge exactly once and produce a valid traversal.

The example value has been entered. Check it immediately or change the value.

Input is processed in the browser. Refreshing returns a sample value.

Result

Instructions and example

If non-isolated vertices are connected and there are 0 or 2 odd-degree vertices, construct a Hierholzer traversal.

Edges 1–2, 2–3, 3–1 admit 1→2→3→1, using each edge once.

Use 1–50 nodes and 1–200 edges. Parallel edges and self-loops remain separate edges. Isolated vertices with no edges are excluded from traversal. Floating-point results display at most 12 significant digits.

Frequently asked questions

May an Euler trail revisit vertices?

Yes. The restriction is using each edge once, not visiting each vertex once.

Does failure suggest extra edges to add?

No. It reports nonexistence without duplicating edges or calculating a shortest detour.

Calculation criteria and reference materials

Verification of calculation criteria: · Calculation·verification principles · Report errors