### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,123)
- misc (2)
- project euler (2)
- puzzle (31)
- site news (43)
- tantalizer (31)
- teaser (3)

### Site Stats

- 168,282 hits

Programming Enigma Puzzles

22 January 2016

Posted by on **From New Scientist #1477, 10th October 1985** [link]

An n-circuit is a closed path of n different points and n different legs. Every leg runs along a grid-line and every point is a junction of grid-lines. Legs do not overlap, but they may cross.

A clear circuit is one that you cannot make a circuit with just some of the points. Thus the 5-circuit

Ais not clear. Points 1, 2 and 5 would make a 3-circuit: so would points 3, 4 and 5. ButBis clear.The length of a circuit is just the sum of the lengths of the legs. Thus

Ahas length 7, andBhas length 11.Can you find a clear 12-circuit with a length of 21 (or less)?

A similar problem to **Enigma 325**.

[enigma329]

Advertisements

%d bloggers like this:

From my perspective this is an easier variation on

Enigma 325. Having solved the previous puzzle I already have code to generate “clear”n-circuits, and calculating the length of a circuit is much easier than calculating the area it encloses (in fact the program accumulates the list of edges that make up the circuit as it goes, so we can even prune away circuits that exceed the maximum required length as they are constructed).This Python program runs in 2.9s.

Solution:Yes. It is possible to find a clear 12-circuit with a length of 21.Here’s a nice symmetrical solution:

This has a maximum leg length of 3, and encloses 55 triangles.

Another solution, also with a maximum leg length of 3, is:

This shape encloses 37 triangles.

The published solution is shown below, it has a maximum leg length of 5, and encloses 41 triangles:

These shapes (along with their reflections/rotations) are the only solutions, and each has a perimeter of length 21.