04. Strategies for solving 'simple' Gnonograms

Many puzzles can be solved by considering only one row or column at a time. Certain cells in that row/column can be inferred to be filled or empty. The effect of completing those cells on other rows/columns is then considered. This is repeated until the puzzle is complete.

Below are some methods that can be applied to single rows/columns.

See A1. Word Meanings for the meanings of italicised words

In the examples below the colours have the following meanings:

Grey - unsolved

Solid blue -filled

Solid yellow - empty

Translucent red - leftmost possibility of block

Translucent blue - rightmost possibility of block

Purple - overlap of leftmost and rightmost possibilities - cells that can be inferred as filled

Fixed Cells

If the freedom in a region is less than the length of one or more of the blocks known to be confined to that region then (length - freedom) cells in the centre of the range of that block must be filled. These are the cells where the block overlaps with itself when placed at the two extremes of its range.

Example 1a

result ...

An block length 11 in a 15 cell row. Freedom is 15-11=4. Filled region length 11-4=7.

Example 1b

result ...

Three blocks in a 15 cell row. Freedom=15-4-1-1-1-5=3. Filled regions lengths 4-3=1 and 5-3=2

Example 1c

result ...

Three blocks in a 15 cell row with three cells marked empty (yellow) dividing it into three subregions of length 3,5 and 4. Because only one block can fit in each sub-region they can be considered separately, each with its own value for freedom. Filled regions lengths 2-1=1, 3-2=1 and 2-2=0

Example 1d

result ...

Four blocks in a 15 cell row divided into four subregions. The second block can only be in the second region and the last block can only be in the last region. However, the 1-cell blocks could be in more than one region. Nevertheless, some cells can be fixed in the last region.

Unreachable

When a block has been associated with a particular range of filled cells, then those cells that out of range of any block can be marked as empty. This most often applies to the first and last blocks.

Example 2a

result ...

The filled cells must be part of the only block in the clue. This restricts the possible range of the block and the cells at the extremes of the region must be empty. Note also that unknown cells between two filled cells belonging to the same block can be filled in.

Example 2b

result ...

The two blocks are pinned near the edge by the filled cells. The central cells can be marked empty.

Edge effects

If a known filled cell occurs at or near the edge of a region, within range of the first block in that region, then further cells may be filled in. This can be employed in either direction.

Example 3a

result ...

A filled cell at the beginning/end of a region. The first/last block can be completed and capped with an empty cell. The block is fixed to the edge.

Example 3b

result ...

A filled cell near the beginning/end of a region, within range of the first/last block. Some cells can be completed. The block is 'pinned' near the edge.

Example 3c

result ...

An example where the 'edge' is away from the sides of the region. The pair of filled cells can only be associated with the first 3-cell block and therefore this can be completed and capped.

No room

If the unassigned space between two empty cells is smaller than any unassigned block then that space can be filled with empty cells.

Example 4a

result ...

The 5 cell block cannot fit between the two empty cells so the the gap can be marked empty.

The same logic can sometimes allow blocks to be allocated to specific regions, which may allow some cells to be filled in using the "fixed cells" or "edge effects" logic shown above

Example 4b

result ...

The two-cell regions in the centre exclude the three- and four-cell blocks. The three-cell block can be fully fixed in the first region. Three cells of the four-cell block can be fixed in the last five-cell region.

Too big

If there is a group of filled cells that is longer than a certain block, that block cannot overlap (or adjoin) these cells and this limits the range of that block. This may allow cells to be filled.

Example 5a

result ...

The 2-cell block cannot be associated with the 3 filled cells - this must be part of the 4-cell block. So the 2-cell block is restricted to the first three cells allowing one cell to be filled.

Gap can be marked empty

If there is a single cell gap between two filled cells and filling it would result in a block longer than any possible block, then the gap can be marked empty. If the blocks on either side can be identified then they can then be completed.

Example 6a

result ...

Filled the gap would result in a 4-cell block which is longer than any possible. Therefore the gap must be empty. The 3-cell block can be completed on the left and the 2-cell block completed on the right. Some 'out of reach' cells can also be marked empty.

Example 6b

result ...

Filled the gap would result in a 3-cell block which is longer than any possible. Therefore the gap must be empty. However, the filled cells could be associated with either a 1-cell block or the 2-cell block, so cannot be completed.