Foundation
The line sweep
Every row holds exactly one queen and so does every column. The line sweep turns that into placements — and, used properly, into a ranking of where the next deduction is most likely to hide.
The basic form
Walk each row and count the open squares. One open square means a forced queen, because a row cannot go empty. Do the same down each column. That is the sweep in its simplest form, and on a board that has already seen a few placements it will often hand you two or three queens in a single pass.
The line sweep is the natural partner to the region sweep, and the reason to run both is that they peak at different times. Regions collapse early because they are small and irregular. Lines collapse late, once queens are on the board and their rows, columns and diagonal neighbourhoods have chewed through the grid. A board that gave you nothing on the line sweep five moves ago may give you three queens on it now.
Counting colours per line
There is a second, less obvious use for walking the lines, and it is one of the cheapest improvements available to an intermediate player. Instead of counting open squares, count distinct colours. Walk each row and note how many different regions it passes through, then do the same for the columns.
The lines touched by the fewest colours are the most constrained parts of the board. If a row meets only two colours, then one of those two must supply its queen, and every other colour on the board is competing for the remaining rows. That is a strong statement, and it costs a few seconds to discover. If a row meets seven colours, it carries almost no information and will be among the last things to resolve.
Use the count as a search order rather than a technique in its own right. When you need a deduction and nothing is forced, start looking at the two or three tightest lines instead of scanning from the top-left corner. Most of the narrowing patterns — a colour locked to a line, a line locked to a colour, a pairing — appear where the colour count is low, because that is where the competition for space is fiercest.
The inverse: lines that belong to one colour
A special case of the count is worth naming separately. If every open square left in a row belongs to a single colour, that colour must supply the row's queen — which means the colour cannot place its queen anywhere else on the board. Every square that colour owns in other rows can be crossed out immediately.
This is a genuinely powerful move because it acts at a distance. The deduction happens in one row and the eliminations land somewhere else entirely, often several rows away, on squares you had no reason to be looking at. It is also easy to miss, because you have to notice the absence of other colours rather than the presence of something.
The mirror image is the technique covered in the region-and-line lock article: a colour whose open squares all sit in one line claims that line for itself. The two are the same idea approached from opposite ends, and learning to see both roughly doubles how often you spot either.
Endgame discipline
The last three or four queens on a board are almost always found by the line sweep, and they are also where careless players lose completed solves. By that stage the grid is mostly crossed out, the remaining options look obvious, and it is tempting to place the final queens by eye.
Do not. The no-touching rule is still live, and two of the last queens sitting diagonally adjacent is the classic way to finish a board that does not validate. Before placing the last few, confirm each one against all four constraints: its row is empty, its column is empty, its colour is unused, and no existing queen touches it — including corner to corner.
Worked example
This is the technique firing on a real board: 7x7 #40, at step 5 of a 8-step solve. The first board is the position as the technique becomes available; the second is the same board after it has been applied.
Look along row 6: one square survives, row 6, column 3, which belongs to red. A row cannot be left empty, so the queen goes there. Everything else in row 6, in column 3, in red and in the ring around that square is now dead.
Related techniques
- The region sweep — The region sweep is the cheapest deduction in Queens and the one most players under-use. How to run it, when to run it, and why it finds queens the line sweep misses.
- When a colour owns a line — If every open square of a colour lies in one row or column, that line belongs to it and every other colour is locked out. How to spot region-line locks and the reverse pattern.
- Solving 11x11 and 12x12 — Techniques that work on a 7x7 board break down at 12x12. How to work locally, split the board into quadrants, and stop full re-scans from eating your solve time.