Fish
Basic Fish
A fish in Sudoku is a structure formed by the intersections of n rows and n columns on the board. Fish techniques use such a structure for a single candidate digit x to eliminate candidates.
If all occurrences of candidate digit x in n rows (or columns) are confined to exactly n columns (or rows), they form a fish. The selected n rows (or columns) are called the base set. The n columns (or rows) containing those candidates are called the cover set. The n × n cells at their intersections are called the fish cells.
Once a fish is formed, each row (or column) in the base set must eventually contain one placed digit x, for a total of n placements. All of them lie within the cover set. Since Sudoku rules prevent two xs from appearing in the same column (or row), each column (or row) in the cover set must contain exactly one of these placements. Therefore, x cannot be placed in any cell of the cover set outside the base set, and any candidate x in those cells can be eliminated.
Candidate digit x does not have to appear exactly n times in every house of the base set; all its occurrences simply have to lie within the cover set. In practice, however, each base house is usually expected to contain at least 2 occurrences of x. Otherwise, the fish is considered degenerate.
Here, the number n of houses (rows or columns) contained in the base set or cover set is called the fish's size or order. So when size matters, a fish may be called an "n-fish". Since the size of a fish affects how difficult it is to spot, fish of different sizes are usually treated as different techniques.
In theory, n can be any integer from 1 to 9. When n=1, the intersection of one row and one column reduces to a single cell, which can be handled as a hidden single and used to eliminate candidates from its peers. When n=9, the base set includes all rows (or columns), leaving no cells in the cover set outside the base set, so the fish rule has no candidates to eliminate. For practical human solving, fish with n ≥ 5 are difficult to spot, so other techniques are usually preferable for simplifying the puzzle.
Finned Fish
Sometimes the candidates in n base rows (or columns) are not all confined to n cover columns (or rows): there are extra occurrences of candidate x in the base set. Even so, analyzing these extra candidates may still allow eliminations.
To analyze such a pattern, select n rows (or columns) containing candidate x as the base set and n columns (or rows) containing x as the cover set. The extra base candidates that lie outside the cover set are called fins, and their cells are called fin cells.
There are only two possibilities: either none of the fin cells contains x, or at least one fin cell contains x.
If a target cell lies within the cover set but outside the base set, and sees every fin cell, we can reason as follows:
- If none of the fin cells contains
x, the base and cover sets form a fish (which can be a degenerate fish), which eliminates candidatexfrom the target cell. - If at least one fin cell contains
x, Sudoku rules prevent the target cell from containingx, because it sees every fin cell. Candidatexcan therefore be eliminated in this case as well.
Therefore, candidate x can be eliminated from any cell within the cover set that lies outside the base set and sees every fin cell.
Degenerate Fish
Even when a fish satisfies the condition that all base candidates lie within the cover set, a base house may contain only one occurrence of x. Such a pattern is usually handled by placing that x as a hidden single rather than applying an n-fish. The remaining fish then degenerates into a size-(n-1) fish. Further singles may then cause it to degenerate into a still smaller fish or entirely into singles, without needing a basic fish technique.
In the example above, the left board shows a degenerate Swordfish for digit 3. Row 8 in the base set has only one fish cell where 3 can be placed. Placing this hidden single gives the board on the right: the Swordfish (size-3 fish) degenerates into an X-Wing (size-2 fish), which can still eliminate candidate 3 from R7C7 in the cover set.
In the example above, the left board shows a degenerate X-Wing for digit 5. Row 6 in the base set has only one fish cell where 5 can be placed. Placing this hidden single gives the board on the right: the X-Wing (size-2 fish) degenerates into a hidden single in R2C1, which can still eliminate candidate 5 from R4C1 in the cover set.
A degenerate fish still satisfies the fish condition: all occurrences of candidate digit x in the n base rows (or columns) are confined to the n cover columns (or rows). Therefore, candidate x can still be eliminated from cells in the cover set outside the base set.
Sashimi Fish
A degenerate fish is usually handled by placing singles to simplify the board, then looking for a smaller fish or further singles, rather than treating it as a basic fish of the original size.
For a finned fish, however, the degenerate fish discussed here forms in the hypothetical case where none of the fins contains x. Singles that arise in this case cannot be placed directly on the actual board. The part of a finned fish outside its fins may therefore be a degenerate fish.
A finned fish whose remaining pattern is a degenerate fish when all fins are false is called a Sashimi Fish.
Sashimi Fish use the same elimination rule as other Finned Fish: eliminate candidate x from any target cell that lies within the cover set, outside the base set, and sees every fin cell. This site therefore treats Sashimi Fish as special cases of Finned Fish, rather than listing them as separate techniques.