Country Road Puzzle

Play Country Road, plus the measurement: the loop traces a Hamiltonian cycle of the regions, which explains most of solvability but never all of it.

Click between two cells to lay a piece of road, and click it again to take it away. Draw one closed loop that goes through every region exactly once, passing through as many cells of a region as its number says. No two unused cells may sit either side of a region border. Everything runs in your browser; nothing is uploaded.

The loop traces a Hamiltonian cycle of the regions

Because the loop visits every region exactly once, the order in which it meets them is a cycle through every region — a Hamiltonian cycle of the graph whose vertices are regions and whose edges join regions that touch. That makes it a necessary condition before a single number is read: no Hamiltonian cycle, no puzzle.

That can be checked rather than just argued, because the two things are computed by programs sharing no code — a backtracking cycle finder on the region graph, and an exhaustive loop search on the grid that knows nothing about region graphs. Across 720 random layouts, "has a loop but the region graph is not Hamiltonian" happened zero times.

BoardRegions Region graph HamiltonianActually has a loop So it explainsPasses but no loop
5×5 4 60.0% 56.7% 94.5% 4
5×5 5 50.0% 48.3% 96.6% 2
5×5 6 44.2% 39.2% 88.7% 6
6×6 5 45.8% 39.2% 85.6% 8
6×6 6 47.5% 40.8% 85.9% 8
6×6 7 44.2% 40.8% 92.3% 4

Necessary is not sufficient, though, and the last column is the point. A Hamiltonian cycle says the regions can be strung together in some order; it says nothing about whether a path through real cells can realise that order while leaving no two unused cells facing each other across a border. The condition explains between 85.6% and 96.6% of solvability — most of the puzzle, never all of it.

The table is frozen, so a fresh sample of 70 layouts it has never seen is re-run at build time as a check: 44.3% Hamiltonian, 42.9% solvable, and again not one loop without a Hamiltonian region graph.

Which of the rules actually does the work

Rules in force 5×5, 5 regions6×6, 6 regions
any closed loop at all 60 / 6060 / 60
+ each region entered at most once 60 / 6060 / 60
+ every region visited 30 / 6025 / 60
+ no two unused cells across a border 30 / 6021 / 60

Read down the column. Every layout has some closed loop in it — a grid is far too free for that to bind. Entering each region at most once costs nothing either, on a random layout. The rule that does the work is having to reach every region, which is exactly the rule that makes the region graph Hamiltonian.

The border rule — the one that feels most exotic when you first read it — costs the least of all once the others are in force. It is doing its work on which loops are legal rather than on whether any exist.

Why these grids are drawn by hand

A puzzle needs exactly one answer. Take the layouts that do have a loop, number every region — the most generous puzzle possible, since real ones leave some blank — and count the answers again:

BoardRegionsLayouts with a loopExactly one answer
5×5 5 134 40 — 29.9%
6×6 6 136 16 — 11.8%
6×6 7 123 22 — 17.9%
7×7 8 24 0 — 0.0%

Most of them still have several answers, and it gets worse as the board grows — at 7×7 not one of the 24 layouts with a loop was pinned down at all. Sampling a layout and numbering it does not make a puzzle. The grid has to be chosen, which is the practical reason Country Road boards are designed rather than generated and kept. The puzzles above are generated and then rejected until one has a single answer.

How to use

  1. Click between two cells to lay a piece of road, and click again to remove it.
  2. Draw one closed loop that passes through every region exactly once.
  3. A region’s number says how many of its cells the loop goes through.
  4. No two unused cells may sit either side of a region border.
  5. Press Show the answer if you get stuck.

Frequently asked questions

What are the rules of Country Road?

Draw a single closed loop through cell centres. It must pass through every region exactly once, so its cells inside a region form one unbroken run. A region’s number says how many of its cells the loop uses. And no two orthogonally adjacent cells on opposite sides of a region border may both be left off the loop.

What is the trick to solving one?

Think in regions rather than cells. Because the loop enters each region exactly once, the order in which it meets them is a cycle through every region — a Hamiltonian cycle of the graph whose vertices are regions and whose edges join regions that touch. Working out which region can follow which usually narrows the puzzle faster than counting cells.

Does a Hamiltonian region graph guarantee a solution?

No, and this is the interesting part. It is necessary but not sufficient. Across 720 random layouts a loop never once appeared without one, but between 1.7 and 6.7 per cent of layouts pass the test and still have no loop — a cycle through the regions says they can be strung together in some order, not that real cells can realise it.

Which rule does the most work?

Having to reach every region. Every random layout contains some closed loop, and entering each region at most once costs nothing on top of that — but requiring the loop to visit them all cuts the survivors by about half. The border rule, which feels the most exotic when you first read it, costs the least of all.

Why are real Country Road grids drawn by hand?

Because sampling a layout does not make a puzzle. Two thirds of random layouts have no loop at all, and of the ones that do, most have several answers even when every region is given a number. On a 7 by 7 board not one of the 24 layouts with a loop was pinned down to a single answer.

How are the puzzles here generated?

By generating layouts and rejecting them. Each candidate is searched for a loop, numbered from the loop it found, then searched again to count the answers — and it is thrown away unless there is exactly one. Most candidates are discarded, which is precisely why the boards stay small.

Does this send anything anywhere?

No. Every puzzle is generated and checked in your browser, and nothing is uploaded.

🔒 This tool runs entirely in your browser. Nothing you enter is uploaded, logged, or stored.