Eulerian Path: Drawing Without Lifting or Retracing
Consider the two shapes shown in . Do you think you can draw them subject to following two rules:
- Don't lift your pen.
- Don't trace any edge more than once.

If you haven’t seen this puzzle before, now’s a good time to try it yourself.
Assuming you gave it a try, most of you probably figured out how to draw the first shape. If not, don’t worry — I’ll demonstrate it in a moment. Now, for the second shape — you likely found it tricky. That’s because it’s impossible to draw the second shape without lifting your pen or retracing a line.
A natural question comes up about the possibility/impossibility of drawing without lifting your pen and retracing any edge more than once.
When is it possible—or impossible—to draw a shape without lifting your pen and retracing any edge?
To answer this question, we’ll look at the two example shapes () in detail. But before we dive into the puzzle, let’s define a key idea: Eulerian path. If it’s possible to trace a shape following these rules — no lifting, no repeating edges — that path is called an Eulerian path. This idea comes from graph theory in mathematics. There's a theoretical result guaranteeing existence of an Eulerian path under certain conditions. Instead of deriving those conditions, we will use the two shapes in to understand those conditions qualitatively. We summarize the conditions guaranteeing existence of an Eulerian path in without a proof.Proof of possibility and impossibility of existence of Eulerian path
Possibility of an Eulerian path for the first shape
Let’s start with the first shape.

We claim that this shapes has an Eulerian path and the simplest way to prove it is by drawing it.
One possible Eulerian path for the first shape is shown in . Start at vertex B, then go to A, D, back to B, then C, D, E, A, and finally end at C. Note that each edge is used exactly once making it a valid Eulerian path. This proves existence of an Eulerian path for the first shape.
Impossibility of Eulerian path for the second shape
The second shape looks similar to the first shape but lacks an important feature essential for existence of an Eulerian path.

To understand why it is impossible to draw an Eulerian path for the second shape, let’s consider two cases. In case 1, we consider drawing an Eulerian path starting and ending at the same vertex. In case 2, we consider drawing an Eulerian path starting and ending at the different vertices.
If case 1 is possible, Eulerian path is also known as an Eulerian circuit — it’s a special kind of Eulerian path where you return to the starting point. In this case, every vertex must have an even number of edges connected to it. That’s because each time you draw an edge to reach vertex, you must draw another edge to leave the vertex. So, edges come in pairs — meaning each vertex must have an even degree (an even number of connected edges). If even one vertex has an odd number of edges, it breaks the condition — and you can't return to the starting point without repeating or lifting the pen.
If case 2 is possible, Eulerian path begins at one vertex and ends at another. In this case exactly two vertices can have an odd number of edges — the start and end points. All other vertices must have an even number of edges. Why? Because the start vertex has one extra edge going out, and the end vertex has one extra edge coming in. All other vertices must still follow the in-out pairing — so they need even degrees.
Now, look at the second shape closely. It has four vertices, and all four have an odd number of edges connected to them. That means it doesn’t fit either case — so it’s not possible to draw an Eulerian path for the second shape.
Conclusion
To summarize, a connected graph has an Eulerian path if it satisfies one of these two cases.
- All vertices have an even number of edges connected to it. In this case an Eulerian path starts and ends at the same vertex.
- Only 2 vertices have an odd of edges connected to it. In this case, an Eulerian path starts and ends at different vertices.
Remarks
In our analysis, we have shown neccessity of these two conditions for existence of an Eulerian path. To prove sufficiency, one would have to provide an algorithm to generate an Eulerian path for any given shape satisfying any of these two conditions.Author
Anurag Gupta is an M.S. graduate in Electrical and Computer Engineering from Cornell University. He also holds an M.Tech degree in Systems and Control Engineering and a B.Tech degree in Electrical Engineering from the Indian Institute of Technology, Bombay.
Comment
This policy contains information about your privacy. By posting, you are declaring that you understand this policy:
- Your name, rating, website address, town, country, state and comment will be publicly displayed if entered.
- Aside from the data entered into these form fields, other stored data about your comment will include:
- Your IP address (not displayed)
- The time/date of your submission (displayed)
- Your email address will not be shared. It is collected for only two reasons:
- Administrative purposes, should a need to contact you arise.
- To inform you of new comments, should you subscribe to receive notifications.
- A cookie may be set on your computer. This is used to remember your inputs. It will expire by itself.
This policy is subject to change at any time and without notice.
These terms and conditions contain rules about posting comments. By submitting a comment, you are declaring that you agree with these rules:
- Although the administrator will attempt to moderate comments, it is impossible for every comment to have been moderated at any given time.
- You acknowledge that all comments express the views and opinions of the original author and not those of the administrator.
- You agree not to post any material which is knowingly false, obscene, hateful, threatening, harassing or invasive of a person's privacy.
- The administrator has the right to edit, move or remove any comment for any reason and without notice.
Failure to comply with these rules may result in being banned from submitting further comments.
These terms and conditions are subject to change at any time and without notice.
Similar content
Past Comments