Swordfish in Sudoku

A swordfish is a pattern on one digit across three rows and three columns. If the digit has only two or three possible cells in each of three rows, and all those cells fall in the same three columns, the digit can be removed from the rest of those columns. It extends the X-wing from two lines to three.

When to use it

  • You have notes on the board and an X-wing search has found nothing.
  • One digit has two or three candidate cells in each of three rows.
  • The candidate cells of those three rows together fall in only three columns.
  • You are working on an expert puzzle and every simpler technique has stopped.

How to spot it

  1. Choose a digit and list the columns of its candidates in each row.
  2. Select rows where the digit has two or three candidates.
  3. Find three such rows whose candidates, taken together, fall in only three columns.
  4. Remove the digit from every other cell of those three columns.
  5. Repeat with columns as the base lines, which removes the digit from the rest of the three rows.

Worked example on a real board

This is a real position from puzzle expert-0115 of our library. 61 of the 81 cells are filled in and 20 are still empty.

Highlighted cells form the pattern. Crossed-out candidates are the ones the technique removes.

In rows 1, 2, and 8, the digit 8 can only go in R1C4, R1C9, R2C3, R2C9, R8C3, and R8C4. Whichever way it falls, it uses up columns 3, 4, and 9, so 8 can be removed from the other cells of columns 3, 4, and 9: R3C4, R3C9, and R6C3.

Candidates in the cells that matter:

  • R1C4: 5 and 8
  • R1C9: 5 and 8
  • R2C3: 2 and 8
  • R2C9: 8 and 9
  • R3C4: 2, 5, and 8
  • R3C9: 5, 8, and 9
  • R6C3: 2, 7, and 8
  • R8C3: 7 and 8
  • R8C4: 7 and 8

Result: these candidates are removed: R3C4 (loses 8), R3C9 (loses 8), and R6C3 (loses 8).

Why it works

Each of the three rows needs a copy of the digit, and the only places left are in three columns. Three rows must use all three columns exactly once, without sharing a column, because a column can hold only one copy of the digit.

So the three columns receive their copies of the digit from these three rows. No other cell in those columns can hold the digit.

The swordfish is rare in practice: in our library it is the least common of the ten techniques, and only expert puzzles use it.

The reasoning is the same as the X-wing: the base lines use up the cover lines, so nothing else in the cover lines can hold the digit. If that clicks, the larger size is only more bookkeeping.

Swordfish compared with X-wing

A swordfish is the three-line version of an X-wing. The logic is identical, but the rows may hold two or three candidates each and do not need to be a neat rectangle, so the pattern is much harder to see. It appears far less often, and when it does it can remove several candidates at once.

FeatureSwordfishX-wing
Cells involved6–9 cells in 3 rows and 3 columns4 cells in 2 rows and 2 columns
Difficulty levelExpert techniqueHard technique
Our puzzles that use it61 / 8,000 (0.8%)480 / 8,000 (6%)
What it doesRemoves 1 digit from the rest of 3 linesRemoves 1 digit from the rest of 2 lines

How often our puzzles need it

Of the 8,000 puzzles in our library, 61 (0.8%) use Swordfish at least once on the way to the solution. In 61 of them it is the hardest technique the puzzle needs.

LevelPuzzlesUse itShareNeed it as the hardest
Easy2,00000%0
Medium2,00000%0
Hard2,00000%0
Expert2,000613%61

A technique is counted when our solver, which always takes the simplest available step first, applies it at least once. A pattern that is on the board but not needed is not counted. These numbers are recalculated from the puzzle files whenever the site is built.

Common mistakes

  • Requiring each row to have three candidates. Rows with two or three candidates both work, as long as the union of columns is three.
  • Counting four columns. If the candidates spread over four columns, there is no swordfish.
  • Removing the digit from the pattern cells themselves. The elimination is in the other cells of the three columns.
  • Looking for it before checking for X-wings, which are easier and more common.

Tips for finding it faster

  • Check for an X-wing first. Many positions that look like a swordfish contain a smaller fish that is easier to apply.
  • For one digit, list each row’s candidate columns and look for three rows whose columns together cover only three columns.
  • Remember that the rows can hold two or three candidates each. A swordfish does not have to use all nine cells.

Frequently asked questions

What is a swordfish in Sudoku?

A swordfish is a fish pattern on one digit. When three rows hold the digit only in the same three columns, the digit can be removed from the rest of those columns. The same pattern works with columns as the base and rows as the cover.

How is a swordfish different from an X-wing?

An X-wing uses two rows and two columns. A swordfish uses three rows and three columns. The logic is the same, but the swordfish is bigger, rarer and harder to see.

Why is it called a swordfish?

The name comes from the family of fish patterns in Sudoku theory. The pattern of size two is the X-wing, size three is the swordfish and size four is the jellyfish.

How rare is the swordfish in our puzzles?

It is the rarest of our ten techniques. The table on this page shows exactly how many puzzles at each level use it, counted from the puzzle library.

Keep learning

Try it yourself on real positions:

Practice Swordfish drillsTake the Swordfish lesson

Two related techniques

All sudoku strategiesOpen the step-by-step solverPlay Expert