Nice Loops
Short answer: build a chain that alternates strong and weak inferences over single candidates, then join its two ends. If the alternation survives the join the loop is continuous, and every weak link in it is promoted to "exactly one of these two" — so any candidate off the loop that is linked to both ends of any weak link comes off. If the alternation breaks at exactly one candidate, the loop is discontinuous, and that candidate is the thing the loop kills.
What a nice loop looks like
Every chain technique below this one is a nice loop with the loop left open. Remote pairs is a chain through bivalue cells, simple colouring a chain through one shape's forced pairs, and an XY-Wing is three links long. Closing the chain changes what you get for it: an open chain proves something about its two ends, a closed one proves something at the join.
Two link types, and the whole technique turns on telling them apart. A strong link says exactly one of these two candidates is true — a shape with only two places left in a unit, or a cell with only two shapes left. A weak link says they cannot both be true — two shapes in one cell, or one shape in two cells that see each other. Every strong link is also a weak one, which is what lets a chain of forced pairs be walked as an alternating chain.
How to use a nice loop
- Find the strong links. Go through the grid marking every shape that has only two places left in a unit, and every cell that has only two shapes left. Those are your strong links, and a loop cannot exist without them — the weak links are free, but they prove nothing on their own.
- Walk an alternating chain. Start on a candidate and leave by a strong link, then a weak one, then strong again. A chain is allowed to switch shapes inside a cell and to switch cells on one shape; what it is not allowed to do is take two links of the same type in a row.
- Close it and check the join. Bring the chain back to where it started. If the closing link keeps the alternation going, the loop is continuous. If it puts two links of the same type together at one candidate, the loop is discontinuous and that candidate is the break.
- Read off what it strikes. A continuous loop turns every one of its weak links into an "exactly one of these two", so strike each candidate outside the loop that is linked to both ends of any weak link. A discontinuous loop with two weak links at the break strikes the candidate at the break itself.
There is a third form worth recognising even though this page's figure does not show it: a break where two strong links meet asserts its candidate rather than striking it. Assume it false, walk the loop, and it comes back true — so it is true, and you can place the shape. form9's solver leaves that one out on purpose, because every other move it makes is an elimination.
Nice loops vs simple colouring
Simple colouring is the same idea with two restrictions: it stays on one shape, and it never closes the chain. Staying on one shape is what makes it findable by eye; giving that up is what makes a nice loop reach further, because a bivalue cell lets the chain change shape mid-stride and a loop can therefore cross the grid diagonally rather than along one shape's conjugate pairs. The cost is real — you are following a longer argument with more places to make a mistake — so it is worth working colouring dry before starting here.
Find Nice Loops in your own grid
Paste a puzzle and this page will look for Nice Loops in it — the same pattern shown above, in your grid instead of ours. Nothing is uploaded; it runs in your browser.
Frequently asked questions
What is the difference between a nice loop and an AIC?
An alternating inference chain is a path and proves something about its two ends: at least one of them is true. A nice loop is the same chain joined into a cycle, and the argument moves to the join. Every nice loop contains an AIC; not every AIC closes.
What makes a loop continuous rather than discontinuous?
Whether the closing link keeps strong and weak alternating all the way round. If it does, the loop is continuous and every weak link in it eliminates. If the join puts two links of the same type together at one candidate, the loop is discontinuous and only that candidate is affected.
Do I need to mark the loop with two colours?
No. The two polarities are just "true if the chain is walked this way" and "true if it is walked the other way", and two pencil marks or letters record that perfectly well. form9 is played with nine shapes and nothing else — marking a chain is a note-taking aid for working one out on paper, not part of how the puzzle works.
Is a nice loop the same as an X-Cycle?
An X-Cycle is a nice loop restricted to a single shape, so every node is the same shape in a different cell. This page allows the loop to change shape inside a bivalue cell, which is the general case; an X-Cycle is what you get when it never does.
Does the form9 solver use nice loops?
Yes — the sudoku solver reaches for them after every easier technique has run dry, and names the move when it does. It looks for the two eliminating forms, continuous and the broken loop with two weak links at the break; the form that asserts a shape is left out because it places rather than strikes.