
Up until this point, all of the solving techniques have been fairly basic and straightforward. But there are a couple of more advanced strategies that are common enough that it is worth including them in the grading system. The first of these strategies is called X-Wing. X-Wings are built upon the premise that if in two separate rows a certain candidate appears only in the exact same two columns, then that candidate can be removed from all other cells in that column (Penny Publications 4). The strategy also works looking for the two same rows from the two same columns. Figure 9 provides an excellent example of an X-Wing situation. In the 5th and 8th columns, the only cells that have 5 as a potential candidate have been highlighted. Because these highlighted cells are in exactly two rows, X-Wing can be applied, and 5 can be removed as a candidate from three cells in those rows, as marked with red cross-outs.
While certainly a more advanced algorithm, X-Wing does not prove significantly more difficult to program. The straightforward approach to take is to loop through all possible combinations of boxes of initial x-position of 1 through 8 and initial y-position of 1 through 8 and terminal x-position between the initial x and 9 and y position between the initial y and 9. These will cover every possible way for an X-Wing to occur. With each box bounded by initial and terminal x and y positions, it is now a matter of determining whether the conditions for X-Wing apply. To do this, the computer simply goes through each candidate in the top left box, and checks to see if this candidate occurs only twice in either both rows or both columns. If it does, it then verifies that the candidate occurs in the corners of the box, and performs candidate removal if so. That takes care of solving all X-Wings. But there is one more peak to climb.
Behind Naked Subsets, the next most difficult solving strategy is Hidden Subsets. This strategy is reminiscent of Naked Subsets, but is based on the exact opposite philosophy. The idea is that if a group of cells of size x in a row, column, or block is the only group of cells to contain a certain x candidates, though not necessarily only those candidates, it is a hidden subset (Armstrong). Within this hidden subset, all candidates can be removed that are not one of the x candidates in question. This sounds a lot like Naked Subsets, but Figure 8 helps to display the difference. The highlighted cells are the only cells to contain 1, 6, or 8 in their candidate sets. Because there are exactly three cells fostering these values, there is a hidden triple, and any other candidate values in these three cells can be eliminated. The middle-left cell now only contains 1, 6 and 8 as candidates, the bottom-center 6 and 8, and the bottom right 1, 6, and eight.
The idea behind a naked subset is that because in a row, block, or column x cells share a combined candidate set of size x, all candidates in that subset may not occur elsewhere in the row, block, or column. For instance, in Figure 7, the candidates 5 and 7 occur in the top-left and bottom-center cells. This means no other cells in the block may contain a 5 or a 7 in their candidate set, as between these two cells, 5 and 7 will be used. 7 can be removed as a candidate from the top-center cell and the middle-left cell. This example also depicts a naked triple, though it may be difficult to see. To have a hidden triple, one must have three cells that share three candidates. It is not necessary for all three cells to have all three candidates. All that is needed is a candidate set of size 3 when combining the candidate sets of three cells and removing duplicates. Adding the candidate sets of the top-right, middle-right, and bottom left cells one gets {1,2,3} + {1,2} + {1,3) = {1,2,2,3,3}, and removing duplicates, simply {1,2,3}. So between three cells, there are exactly three candidates, so it follows that those candidates must be used between those three cells and thus cannot be in any other cells in the block. 1 can be removed as a candidate from the middle-left cell.
The Block-Row/Column Interactions strategy concerns itself with pinpointing a certain candidate to a single row or column of a block. If this candidate can only appear in this row or column, then outside of the block in that row or column one can eliminate that candidate. Figure 5 depicts a Block-Column/Row interaction. Because in the middle block, 5 may only occur in the blue spots, and these spots are in the same column, it follows that 5 cannot be a candidate for any of the highlighted squares.
except that it deals with two blocks. The idea behind the strategy is that if between two of three blocks in the same row or column, a certain candidate only occurs in two rows or columns, it can be eliminated from those rows or columns in the third block. Figure 6 demonstrates this for the candidate 5. In the first two blocks, 5 can only be a candidate in the cells with blue circles, which are limited to two rows, so this means 5 cannot be a candidate in these yellow columns in the third block. One can describe the strategy using an alternate method as well. If in any row or column, a certain candidate may only appear in one block, then in that block the candidate cannot occur anywhere but in that row or column (Armstrong). Looking at figure five again, one can see that in the third row, the only cells where 5 may occur are the red cells, which all share the same block. This means that being in the same block, the yellow cells cannot have 5 as a candidate.
Now the final value-setting strategy remains: Hidden Singles. The Hidden Singles strategy says that if a cell in a given row, column, or block is the only one to contain a candidate x, then the cell’s value must be x. Slicing and Slotting is a specific case of this strategy. For example, in Figure 4, although by simple candidate exclusion the highlighted cell may contain all values except for 5, 2, 1, 4, and 7, because it is the only cell in the block with 9 as a candidate, its value must be 9. As long as only one cell in a row, block, or column has a certain candidate available, that cell’s value must be that candidate’s value.
Although it is not conceptually the next-easiest strategy, Slicing and Slotting is the second-easiest strategy to spot and use. Slicing and slotting is looking for all occurrences of a certain value, and seeing if the locations of the value throughout the grid force a cell to be the only one in its block to be able to contain that value. Figure 2 illustrates this quite well. Because the 2 cannot occur in the first and third columns, and in the third row, and there is only one remaining empty cell outside of these rows or columns in the first block, the 2 must occupy that empty position.