Resource · Guide or article
Eulerian Path
Explains Eulerian trails and circuits, which use every edge exactly once, and the degree rules that decide whether one exists.
Reviewed
Open the original: Eulerian Path (opens the original site in a new tab)Practice this topicOpens the practice interviewer with a question on Graphs.
Add to a roadmap
Keep this resource with a roadmap you follow. It appears as your own extra resource; the roadmap's steps don't change and it doesn't count toward your tracked steps.
Source content: English
In graph theory, an Eulerian trail (or Eulerian path) is a trail in a finite graph which visits every edge exactly once. Similarly, an Eulerian circuit or Eulerian cycle is an Eulerian trail which starts and ends on the same vertex. Euler proved that a necessary condition for the existence of Eulerian circuits is that all vertices in the graph have an even degree, and stated that connected graphs with all vertices of even degree have an Eulerian circuit. Every vertex of this graph has an even degree. Therefore, this is an Eulerian graph. Following the edges in alphabetical order gives an Eulerian circuit/cycle.
PrepKit overview
PrepKit editors wrote and reviewed this overview from the source repository. It is not text from the resource itself.
- Suited to
- The source does not state a level
- Format
- Reference
What it covers
- Definitions of Eulerian trail, Eulerian circuit and semi-Eulerian graph
- Degree rules: all even for a circuit, zero or two odd vertices for a trail, which then runs between the odd pair
- The Konigsberg bridges multigraph as a case with no solution
How to use it
PrepKit study advice, not a claim made by the source.
Write a checker that reports trail, circuit or neither from vertex degrees, then extend it to build the circuit. Konigsberg should return no solution.
Scope and limitations
Theory only: no construction algorithm such as Hierholzer's, no complexity, and directed graphs are not addressed.
Access and format
Free English README on GitHub in the MIT-licensed trekhleb/javascript-algorithms repository.
Reviewed by PrepKit on Oct 2, 2026. Listing source commit: 85293e3e2b88
Evidence behind this overview
- src/algorithms/graph/eulerian-path/README.md
Pages that include this
Get the PrepKit newsletter
Optional. You don't need it to use PrepKit.