Uniqueness Techniques

These techniques are valid only for grids with a unique solution. Grids generated by JSudoku will always have a unique solution, but when using some other source, before using any uniqueness technique, JSudoku will bring a dialog asking you to either verify the unique solution, disable all uniqueness techniques or trust the puzzle designer and assume the unique solution.

The basic principle for uniqueness techniques is to avoid deadly patterns, which yields multiple or no solution.

Uniqueness Tests alias Unique Rectangle (UR)

These form a family of techniques which all avoid the rectangle deadly pattern, also known as Unique Rectangle (UR). For vanilla 3x3 Sudoku, there are potentially 486 URs, but we should exclude all those hitting any given clue which do not form deadly patterns. There are even fewer URs for many variants like Sudoku-X, Windoku, Jigsaw, Gattai, Killer Sudoku... For Sudoku-X we should exclude every rectangle hitting a diagonal. For Windoku, we should exclude every rectangle with only one cell in a window (incl. hidden windows). Similarly for Killer Sudoku and any variant with extra houses or constraints. For Greater/Less Than Sudoku, there aren't any URs since swapping digits would violate the greater/less than relations... Similarly for (non) consecutive, very few URs are deadly, if any. More generally, to form a deadly pattern, one could swap digits in the solution without violating any rules, constraint or given clues, whichever they are: given cells, killer cage, Greater/Less Than, (non) consecutive...

JSudoku catches all Uniqueness Tests types 1 to 6 as well as Hidden UR. See also Sudopedia.

Uniqueness Test 1

This is the simplest of the Uniqueness Tests and easiest to spot. The rectangle is almost deadly, except for one cell with extra candidate(s). To avoid the deadly rectangle, that cell must hold (one of) the extra candidate(s). In this example, R7C6 has only one extra candidate 2, so it must hold 2.

In this example, R2C8 cannot hold 1 nor 6 which leaves two extra candidates {28}.

Uniqueness Test 2

The rectangle is almost deadly, except for two side cells with the same extra candidate. To avoid the deadly rectangle, one of the extra cells must hold the extra candidate. Therefore the extra candidate is locked for the row or column, and possibly the block. In this example, one of R89C9 must hold the extra candidate 9 which is locked for C9 and N9, which reveals R5C9 = 6.

Uniqueness Test 3

The rectangle is almost deadly, except for two side cells with several extra candidates. To avoid the deadly rectangle, at least one of the extra cells must hold some extra candidate(s). Therefore these two cells forms an almost locked set (ALS) for the extra candidates, which may form a locked set with another ALS in the row, column or block. In this example, R13C9 cannot hold both {59}, so they must hold at least one of the extra candidates {12} and forms an ALS. Since R3C9 = {12} (another ALS), {12} is locked in R123C9 for C9 and N3 which reveals R8C9 = 5 and R4C7 = 2.

This is extended to Killer Sudoku where the ALS may be formed by cages.

Uniqueness Test 4

This is an overlap of a rectangle and a strong link for one of the deadly candidate. Two side cells have the deadly canditates only, the opposite side cells have extra candidates and one of the deadly canditates locked for their row or column. Since the extra cells must hold one of the deadly candidate, to avoid the deadly rectangle, they cannot hold the other deadly candidate. In this example, 4 for R5 is locked in R5C26, therefore R5C26 <> 1.

Uniqueness Test 5

The rectangle is almost deadly, except for two diagonal cells or three cells with the same extra candidate. To avoid the deadly rectangle, one of the extra cells must hold the extra candidate. Therefore the common buddies of the extra cells cannot hold the extra candidate. This is similar in logic to Uniqueness Test 2 but usually allows fewer eliminations. This pattern is indeed a rarity. In this example, one of R4C45,R8C5 must hold 6, therefore R56C5 <> 6.

Uniqueness Test 6

This is an overlap of a rectangle and an X-Wing for one of the deadly candidates. Two diagonal cells have the deadly canditates only, the other diagonal cells have extra candidates, one of the deadly canditates is locked for both rows and columns. To avoid the deadly rectangle, the extra cells cannot hold this locked candidate, which reveals hidden singles in the opposite diagonal cells. In this example, 5 is locked in R23C36 for both rows and columns, like an X-Wing. Therefore R2C6, R3C3 <> 5, which reveals R2C3, R3C6 = 5.

Hidden Unique Rectangle

This is between Uniqueness Test 4 and 6. Some cell has the two deadly candidates only. One of the deadly candidate is locked for the row and column of this cell. To avoid the deadly rectangle, the opposite diagonal cell cannot hold the other deadly candidate. In this example 7 is locked in R89C3 for C3 and in R9C35 for R9. The cell is R9C3, therefore the opposite corner cell R8C5 cannot hold 2. The type 2 hidden UR follows the same logic, except one side forms a naked pair for the deadly candidates. See also Scanraid.

Avoidable Rectangles

The deadly rectangle may still exhibit even if some cell(s) is solved (but not given!). The principle is harder to understand, at least for me: imagine the grid is solved, if a deadly rectangle holds two digits only, it would be possible to swap them without affecting the rest of the puzzle, and we would get another solution. JSudoku catches Avoidable Rectangles type 1 to 3 using corresponding Uniqueness Tests solvers. See also Sudopedia.

Bivalue Universal Grave (BUG)

A BUG is a deadly pattern where every unsolved cell has 2 candidates and every house (row, column, block...) have 2 possible locations for each unsolved value. It's a deadly pattern since this yields to two solutions for each of the two possible candidates and locations in the houses.

The BUG+1 follows the same logic as Uniqueness Test 1, but for a larger deadly pattern over all unsolved cells. The BUG+1 is an almost deadly pattern easy to spot which unlocks the grid and reveal singles for all the remaining cells. All cells have two candidates, except one cell with three candidates. All unsolved values have two locations for every houses except for a candidate of the three-value cell. If that candidate were removed, the grid would exhibit the BUG deadly pattern. So this cell must hold this extra candidate to avoid the BUG deadly pattern.

In this example, all cells have two candidates except R2C5. All unsolved candidates have two possible locations for every house except the candidate 6 which has three possible locations for R2, C5, N2. To avoid the BUG deadly pattern, R2C5 must hold 6.


Simple Techniques | Fishes & Single Digit | Wings | XY-Chains, Loops & ALS | Uniqueness | Jigsaw, Windoku & Gatai | Greater/Less Than & Non-Consecutive | Killer | Innies/Outies | Advanced Killer | Square Wisdom | Contents

Copyright (C) 2006-2008 Jean-Christophe Godart. All rights reserved.