# A robot visiting every edge of a 3x3 grid

A robot is placed on the top-left vertex of a 3x3 grid. At each move the robot can take one step (up, down, left or right) along the edge of the grid to the adjacent vertex, but he cannot go outside the grid. The robot can revisit vertices and edges. What is the least number of moves required for it to visit every edge of the grid? Good luck!

• Chinese postman problem – RobPratt Aug 25 '20 at 14:08
• Yes it is indeed! – Dmitry Kamenetsky Aug 25 '20 at 14:12

The minimum number of steps is

$$28$$

How to do it

At step $$n$$ visit the vertex as indicated by the number $$n$$ in the following diagram

Proof that this is minimal

The graph has $$24$$ edges in all.
Eight of the vertices have order $$3$$. This means that these vertices must be visited at least twice and there is an overlapping edge whenever the second incidence occurs. This means there will be at least four edges visited twice and $$24 + 4 = 28$$ and this minimum is achieved when we ensure the ends of the overlapping edges are on vertices of order $$3$$.

• Absolutely brilliant! Great visualisation and proof. Very fast too. Now you can try the harder version of this puzzle. – Dmitry Kamenetsky Aug 25 '20 at 14:07