A section of the city of Tokyo consists of a square grid of city streets, with streets running north-south and streets running east-west. Godzilla is standing at one of the intersections of the grid. He begins walking along the streets of the grid, destroying everything in his path.
After Godzilla destroys a block, he is unable to walk on the same block again. What is the most number of blocks that Godzilla could have destroyed if he ends his rampage at the same intersection that he started on?
Details and assumptions
A block is the distance between two intersections.
The intersections are not destroyed. Godzilla can destroy the blocks between and , then go through the intersection of , for example by walking from to .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Define the degree of an intersection to be the number of streets leading out of the intersection. So the 4 intersections at the corners have degree 2, the 4 × 1 2 = 4 8 intersections at the edges have degree 3, and the remaining 1 2 2 = 1 4 4 intersections in the middle have degree 4.
We will count the number of times Godzilla enters an intersection. This number is clearly equal to the number of blocks that he destroys. He can enter a degree 2 intersection at most once, and a degree 4 intersection at most twice. Also, if he enters and exits a degree 3 intersection he can no longer enter the same intersection again, because then he would have no way out. So he can only enter a degree 3 intersection at most once as well.
(The above argument also works for the intersection that Godzilla starts at, because he has to exit the intersection at the start and enter at the end.)
So the maximum number of blocks he can destroy is 1 4 4 × 2 + 4 8 + 4 = 3 4 0 .
To show that Godzilla can indeed destroy that many blocks, let us colour the blocks. Along each of the 4 edges, colour the blocks black and white alternately, starting with black. Colour the rest of the blocks black. Now there are 4 × 6 = 2 4 white blocks, and 2 × 1 3 × 1 4 − 2 4 = 3 4 0 black blocks.
We want to show that Godzilla can destroy all the black blocks, so let us ignore the white blocks from now on. Then every intersection along the edges are degree 2, and the rest of the intersections are degree 4. Since the degree of every intersection is even, there exists an Eulerian circuit (i.e. a closed path that passes through all blocks) by a well-known theorem of Euler.
Hence Godzilla can destroy a maximum of 3 4 0 blocks, which was what we wanted.