Nonograms

Picross · picture logic
Solved this year
GitHub
MonWedFri
Streak
0 days
Solved
0
Solve time
—

Rules

PuzzleTeam defines the rules as:

The rules are simple:

1.You have a grid of squares, which must be either filled in black or marked with X.
2.Beside each row of the grid are listed the lengths of the runs of black squares on that row.
3.Above each column are listed the lengths of the runs of black squares in that column.
4.Your aim is to find all black squares.

Algorithm

How I actually solve one — the reasoning I run before any code does, written out in full. Read down the right column; the board on the left follows whichever step you are on.

2
3
4
1
3
1
3
1
2
2
5
1
4
5
6
7
2
3
4
2
5
4
5
3
1
3
4
3
1
2
2
1
1
3
1
Step 1 / 6
Step 1

Frame every line as a counting problem

A nonogram is really two interlocking sets of line puzzles: every row and every column carries a clue list — the lengths of its black runs, in order, with at least one blank between consecutive runs. Before touching a cell I size up a single line of length : the runs claim cells plus mandatory gaps, and whatever is left over is slack that can be distributed among the gap positions. That makes the placement count a simple binomial:

A 25-cell row with the clue 3, 4, 2 has slack cells and placements — harmless alone, but a 25×25 board multiplies fifty such lines together, so the global space is hopeless to enumerate. The saving grace is that each line is tiny on its own. The whole method is to reason exactly within one line at a time and let the rows and columns discipline each other through the cells they share.

Test

The robotic solver on real boards: the daily puzzle comes straight from the API, and the samples — 5×5 up to 50×50 — replay recorded solver runs move by move.

Daily Puzzle
fetching the daily puzzle…
Solver trace
awaiting the solver service — the live trace and metrics land together with the API
Fills
—
Backtracks
—
Depth
—
Time
—