### Random Post

### Recent Posts

- Tantalizer 450: Marriage problems
- Enigma 1057: Recycled change
- Enigma 452: Figure out these letters
- Puzzle 46: I lose my specs
- Enigma 1058: A row of colours
- Enigma 451: Double halved
- Tantalizer 451: Death rates
- Enigma 1059: Century break
- Enigma 450: A pentagonal problem
- Puzzle 48: Verse on the island

### Recent Comments

Jim Randell on Tantalizer 450: Marriage … | |

Brian Gladman on Enigma 1057: Recycled cha… | |

Jim Randell on Enigma 1057: Recycled cha… | |

geoffrounce on Enigma 452: Figure out these… | |

Jim Randell on Enigma 452: Figure out these… |

### Archives

### Categories

- article (11)
- enigma (1,183)
- misc (2)
- project euler (2)
- puzzle (46)
- site news (46)
- tantalizer (50)
- teaser (3)

### Site Stats

- 184,974 hits

Advertisements

I thought this was an interesting puzzle to solve programatically.

Firstly we have to deal with the triangular grid (rather than the more normal rectilinear one). I used a similar approach to that in

Enigma 175, where I consider grid axes that are 60° apart.Then we have to write code that will generate “clear” circuits with the required number of legs. I generate circuits with increasing maximum leg lengths.

And finally we have to compute enclosed area of a (possibly) self-crossing circuit. My approach was to construct a box on the grid that encloses the shape, and then label all the triangles inside that box. We start by labelling a triangle on the outside of the shape with 0, then we label all adjacent triangles with 0 or 1 according to whether the shared edge of the adjacent triangles is part of the perimeter of the shape. If the shared edge is not included in the shape, then the value remains unchanged. But if the shared edge is included in the shape then value changes (from 0 to 1, or 1 to 0).

Here is my Python program. It finds the first solution to the puzzle in 7.5s, but you can leave it running to find more solutions.

Solution:Yes – it is possible to find a clear 9-circuit with a fatness of 9 (or less).The neatest looking solution, with a fatness of 7, is shown below:

The maximum leg length is 4.

This figure was the published solution.

Although there are other solutions, with a maximum leg length of 4, that have a fatness of 9:

It could be argued that, although these shapes are less pleasing to the eye, they are a better fit to the question posed in the puzzle.

There are also solutions with a maximum leg length of 5 that also have a fatness of 9:

(Of course the shapes given can be reflected and/or rotated to give similar solutions).

For other Enigmas that have fun on triangular grids see:

Enigma 82,Enigma 144,Enigma 175,Enigma 1774.