Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Nonogram
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Solution techniques== {{multiple issues|section=yes| {{howto|section|date=January 2014}} {{Unreferenced section|date=January 2018}} }} [[File:Paint by numbers Animation.gif|thumb|Example of a nonogram puzzle being solved using crosses to mark logically-confirmed spaces. Some of the steps of the process are grouped together.]] To solve a puzzle, one needs to determine which cells will be boxes and which will be empty. Solvers often use a dot or a cross to mark cells they are certain are spaces. Cells that can be determined by logic should be filled. If guessing is used, a single error can spread over the entire field and completely ruin the solution. An error sometimes comes to the surface only after a while, when it is very difficult to correct the puzzle. The hidden picture may help locate and eliminate an error, but otherwise it plays little part in the solving process, as it may mislead. Many puzzles can be solved by reasoning on a single row or column at a time only, then trying another row or column, and repeating until the puzzle is complete. More difficult puzzles may also require several types of "what if?" reasoning that include more than one row (or column). This works on searching for contradictions, e.g., when a cell cannot be a box because some other cell would produce an error, it must be a space. ===Simple boxes=== At the beginning of the solution, a simple method can be used to determine as many boxes as possible. This method uses conjunctions of possible places for each block of boxes. For example, in a row of ten cells with only one clue of ''8'', the bound block consisting of 8 boxes could spread from [[File:Paint by numbers - Solving - Example1.png|right]] * the right border, leaving two spaces to the left; * the left border, leaving two spaces to the right; * or somewhere in between. As a result, the block '''must''' spread through the six centermost cells in the row. The same applies when there are more clues in the row. For example, in a row of ten cells with clues of ''4'' and ''3'', the bound blocks of boxes could be [[File:Paint by numbers - Solving - Example2.png|right]] * crowded to the left, one next to the other, leaving two spaces to the right; * crowded to the right, one just next to the other, leaving two spaces to the left; * or somewhere between. Consequently, the first block of four boxes definitely includes the third and fourth cells, while the second block of three boxes definitely includes the eighth cell. Boxes can therefore be placed in the third, fourth and eighth cells. When determining boxes in this way, boxes can be placed in cells only when the ''same block'' overlaps; in this example, there is overlap in the sixth cell, but it is from different blocks, and so it cannot yet be said whether or not the sixth cell will contain a box. ===Simple spaces=== This method consists of determining spaces by searching for cells that are out of range of any possible blocks of boxes. For example, considering a row of ten cells with boxes in the fourth and ninth cell and with clues of ''3'' and ''1'', the block bound to the clue ''3'' will spread through the fourth cell and clue ''1'' will be at the ninth cell. [[File:Paint by numbers - Solving - Example3.png|right]] First, the clue ''1'' is complete and there will be a space at each side of the bound block. Second, the clue ''3'' can only spread somewhere between the second cell and the sixth cell, because it always has to include the fourth cell; however, this may leave cells that may not be boxes in any case, i.e. the first and the seventh. Note: In this example all blocks are accounted for; this is not always the case. The player must be careful for there may be clues or blocks that are not bound to each other yet. ===Forcing=== In this method, the significance of the spaces will be shown. A space placed somewhere in the middle of an uncompleted row may force a large block to one side or the other. Also, a gap that is too small for any possible block may be filled with spaces. [[File:Paint by numbers - Solving - Example4.png|right]] For example, considering a row of ten cells with spaces in the fifth and seventh cells and with clues of ''3'' and ''2'': * the clue of ''3'' would be forced to the left, because it could not fit anywhere else. * the empty gap on the sixth cell is too small to accommodate clues like ''2'' or ''3'' and may be filled with a space. * finally, the clue of ''2'' will spread through the ninth cell according to method ''Simple Boxes'' above. ===Glue=== Sometimes, there is a box near the border that is not farther from the border than the length of the first clue. In this case, the first clue will spread through that box and will be forced outward from the border. In the simplest case, whenever a box is present in the first or last cells of a row or column, the first or last clue must be aligned to the edge of that row or column. [[File:Paint by numbers - Solving - Example5.png|right]] Considering a row of ten cells with a box in the third cell and with a clue of ''5'', the clue of ''5'' will always span from the third to the fifth cell (but not necessarily to the second or the sixth). It is therefore possible to mark the third, fourth and fifth cell as belonging to the ''5''. Note: This method may also work in the middle of a row, farther away from the borders. [[File:Paint by numbers - Solving - Example6.png|right]] * A space may act as a border, if the first clue is forced to the right of that space. * The ''first'' clue may also be preceded by some other clues, if all the clues are already bound to the left of the forcing space. ===Joining and splitting=== Boxes closer to each other may be sometimes joined together into one block or split by a space into several blocks. When there are two blocks with an empty cell between, this cell will be: * A space if joining the two blocks by a box would produce a too large block * A box if splitting the two blocks by a space would produce a too small block that does not have enough free cells remaining For example, considering a row of fifteen cells with boxes in the third, fourth, sixth, seventh, eleventh and thirteenth cell and with clues of ''5'', ''2'' and ''2'': [[File:Paint by numbers - Solving - Example7.png|right]] * The clue of ''5'' will join the first two blocks by a box into one large block, because a space would produce a block of only 4 boxes that is not enough there. * The clues of ''2'' will split the last two blocks by a space, because a box would produce a block of 3 continuous boxes, which is not allowed there. ''Note:'' The illustration picture also shows how the clues of ''2'' are further completed. This is, however, not part of the ''Joining and splitting'' technique, but the ''Glue'' technique described above. ===Punctuating=== To solve the puzzle, it is usually also very important to enclose each bound or completed block of boxes immediately by separating spaces as described in ''Simple spaces'' method. Precise punctuating usually leads to more ''Forcing'' and may be vital for finishing the puzzle. ''Note: The examples above did not do that only to remain simple.'' ===Mercury=== ''Mercury'' is a special case of ''Simple spaces'' technique. Its name comes from the way [[Mercury (element)|mercury]] pulls back from the sides of a container. [[File:Paint by numbers - Solving - Example8.png|right]] If there is a box in a row that is in the same distance from the border as the length of the first clue, the first cell will be a space. This is because the first clue would not fit to the left of the box. It will have to spread through that box, leaving the first cell behind. Furthermore, when the box is actually a block of more boxes to the right, there will be more spaces at the beginning of the row, determined by using this method several times. ===Contradictions=== Some more difficult puzzles may also require advanced reasoning. When all simple methods above are exhausted, searching for [[reductio ad absurdum|contradictions]] may help. It is wise to use a pencil (or other color) for that to facilitate corrections. The procedure includes: # Trying an empty cell to be a box (or then a space). # Using all available methods to solve as much as possible. # If an error is found, the tried cell will not be a box for sure. It will be a space (or a box, if space was tried). [[File:Paint by numbers - Solving - Example9.png]] In this example a box is tried in the first row, which leads to a space at the beginning of that row. The space then ''forces'' a box in the first column, which ''glues'' to a block of three boxes in the fourth row. However, that is wrong because the third column does not allow any boxes there, which leads to a conclusion that the tried cell must not be a box, so it must be a space. The problem of this method is that there is no quick way to tell which empty cell to try first. Usually only a few cells lead to any progress, and the other cells lead to dead ends. Most worthy cells to start with may be: * cells that have many non-empty neighbors; * cells that are close to the borders or close to the blocks of spaces; * cells that are within rows that consist of more non-empty cells. ===Mathematical approach=== It is possible to get a start to a puzzle using a mathematical technique to fill in blocks for rows/columns independent of other rows/columns. This is a good "first step" and is a mathematical shortcut to techniques described above. The process is as follows: [[File:Mathematical approach.png|right]] # Add the clues together, plus 1 for each "space" in between. For example, if the clue is 6 2 3, this step produces the sum 6 + 1 + 2 + 1 + 3 = 13. # Subtract this number from the total available in the row (usually the width or height of the puzzle). For example, if the clue in step 1 is in a row 15 cells wide, the difference is 15 - 13 = 2. Note: If spaces can be used on the left or right (top or bottom) borders, this "shrinks" the available area. If it is known that the rightmost cell is a space, the difference is 14 - 13 = 1. # Any clues that are greater than the number in step 2 will have some blocks filled in. In the example, this applies to the clues 6 and 3, but not 2. # For each clue in step 3, subtract the number in step 2 to determine the number of blocks that can be filled in. For example, the 6 clue will have (6 - 2 =) 4 blocks filled in and the 3 clue will have (3 - 2 =) 1. Note: Applying the same procedure to a clue that "failed" step 3 will produce a non-positive number, indicating that no blocks will be filled in for this clue. The clue 2 produces the number (2 - 2 =) 0; if there were a 1 clue, it would produce the number (1 - 2 =) -1. # To fill in the blocks, assume the blocks are all pushed to one side, count from that side "through" the blocks, and backfill the appropriate number of blocks. This can be done from either direction. For example, the 6 clue can be done either of two ways as follows: ## From the left: Since the 6 is the first number, count 6 blocks from the left edge, ending in the 6th block. Now "backfill" 4 blocks (the number obtained in step 4), so that cells 3 through 6 are filled. ## From the right: Starting from the right, the clues that are to the right of the 6 clue must be accounted for. Starting from cell 15, count 3 cells for the 3 clue (to cell 13), then a space (12), then the 2 clue (10), then a space (9), then the 6 clue (3). From the 3rd cell, "backfill" 4 blocks, filling cells 3 through 6. The results are the same as doing it from the left in the step above. # Repeat step 5 for all clues identified in step 3. In the illustration, row 1 shows the cells that are filled under this procedure, rows 2 and 4 show how the blocks are pushed to one side in step 5, and rows 3 and 5 show the cells backfilled in step 5. Using this technique for all rows and columns at the start of the puzzle produces a good head start into completing it. Note: Some rows/columns won't yield any results initially. For example, a row of 20 cells with a clue of 1 4 2 5 will yield 1 + 1 + 4 + 1 + 2 + 1 + 5 = 15. 20 - 15 = 5. None of the clues are greater than 5. Also, this technique can be used on a smaller scale. If there are available spaces in the center or either side, even if certain clues are already discovered, this method can be used with the remaining clues and available spaces. ===Deeper recursion=== Some puzzles may require to go deeper with searching for the contradictions. This is, however, not possible simply by a pen and pencil, because of the many possibilities that must be searched. This method is practical for a computer to use. ===Multiple rows=== In some cases, reasoning over a set of rows may also lead to the next step of the solution even without contradictions and deeper recursion. However, finding such sets is usually as difficult as finding contradictions.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)