Sudoku HowTo

# Almost Locked Sets

Almost Locked Sets are often referred to as ALS.

An almost locked set is a group of n cells in a unit that has n + 1 possible candidates. Almost locked sets are usually quite common in a Sudoku puzzle.

If there are two almost locked sets that have some cells that are buddy cells and those cells contain common candidates there may be a restricted common candidate. A restricted common candidate is a candidate that can be placed in only one of the almost locked sets.

If two almost locked sets with a restricted common candidate can be found, then any cell containing a candidate that is not the restricted common candidate but is common to both almost locked sets can have that candidate removed if the cell is buddy cells with all cells in both almost locked sets that contain that candidate.
The Almost Locked Sets example in Figure 1 shows two almost locked sets, one colored green and the other colored blue. The cells tagged with an 'A' contain the restricted common candidate, in this case the value 5. All cells in both sets containing the candidate 5, tagged with an 'A', are buddy cells to one another so the candidate 5 can only exist in one of these cells and consequently the candidate 5 can be in only one of the almost locked sets.

The grey cell is a buddy cell of every cell in both almost locked sets that contain the candidate 7 (The cells tagged with a 'B'), so the candidate 7 can be removed from the grey cell.

The secret sauce for this strategy is the restricted common candidate.

If the restricted common candidate is placed in either one of the almost locked sets, it cannot be used in the other almost locked set. If there is one less candidate in the other almost locked set it becomes a locked set. If it is a locked set, then the candidates in the locked set will all have to be used to fill the cells in the locked set. None of those candidates can be used in cells that are buddy cells to the cells in the locked set.

In the example, if the value 5 is placed in the blue almost locked set, it cannot be in the green almost locked set. The green almost locked set becomes a locked set. The value 7 has to be placed in the green cell. This removes the candidate 7 from the grey cell.

If the value 5 is placed in the green almost locked set then the blue cells become a locked set. The value 7 will have to be placed in one of the blue cells tagged with a 'B'. Once this happens, no matter which blue cell is chosen, the value 7 cannot be placed in the grey cell because all the cells in the blue almost locked set that can contain the candidate 7 are buddy cells of the grey cell.

Either way, the value 7 cannot be placed in the grey cell so it can be removed from the candidates.

There are additional almost Locked Sets examples in this puzzle that can be seen by loading it in the Sudoku Helper.
Figure 2 shows Almost Locked Sets with a restricted common candidate of 5 and the removal of candidate 4 from one cell.

The cells tagged with an 'A' contain the restricted common candidate 5. Placing the 5 in either of these cells removes the 5 from all other cells tagged with an 'A' and consequently from the other set and makes the other set an locked set.

For either set, the value 4 can only be placed in one cell in that set and using the value 4 in that cell will remove it from the grey cell.

If the candidate 5 is placed in the blue almost locked set, the green cells become a locked set. The candidate 4 will have to be used in the green cell tagged with a 'B'. This will remove the candidate 4 from the grey cell.

If the candidate 5 is placed in the green almost locked set, the blue cells become a locked set. The candidate 4 will have to be used in the blue cell tagged with a 'B'. This will also remove the candidate 4 from the grey cell.

Regardless of which cell is chosen for the restricted common candidate of 5 it causes the elimination of the candidate 4 from the grey cell.
3 February 2023
by Harvey
RE: Comments and feedback for almostLockedSets

It seems to me that R2C7 must be 5 since it is the only 5 in that column, Therefore R3C7 must be 4.
3 February 2023
by Harvey
RE: Comments and feedback for almostLockedSets

It seems to me that R2C7 must be 5 since it is the only 5 in that column, Therefore R3C7 must be 4.
13 December 2021
by John
RE: Comments and feedback for almostLockedSets

Technically a set can be empty, but that does not help with our solution. For this strategy to work the two ALS's cannot have common cells. If the two ALS's have common cells and the restricted common candidate is placed in one of the cells that exists in both ALS's then it cannot be removed from the either of the ALS's so it has not helped.
13 December 2021
by Gregg
RE: Comments and feedback for almostLockedSets

This is very helpful, and now I understand the example. I had previously assumed a set of things contained more than one of the thing. There are around 10 cells in Fig 1 that have only 2 candidates, and so each of these 10 are an ALS.
May I make another query? In row 9 there are 2 ALS, one ALS containing the single cell R9C2, and another ALS containing 2 cells, R9C2 and R9C7. Could you ignore the single cell ALS, and instead used the 2 cell ALS to point out that in a puzzle with several ALS present, the different ALS's can have common cells. The 2 cell ALS would work to achieve the same result because the grey cell is still a buddy cell of every cell in both ALS that contain the candidate 7 (The cells tagged with a 'B').
12 December 2021
by John
RE: Comments and feedback for almostLockedSets

A set can contain only one cell. In this example the green set only has one cell and the blue set contains four cells. They are shown as you expect and this all measn the number 7 can be removed from the grey cell. THe grey cell is not in either of the Almost Locked sets
12 December 2021
by Gregg
RE: Comments and feedback for almostLockedSets

I have a problem with Figure 1 example of ALS.

The example states there are 2 ALS:
BLUE: 4 blue cells with 5 candidates, 14567
GREEN: 1 green cell with 2 candidates, 57. How is it possible a "set" can be a single cell? I wondered if the grey cell was part of the green ALS, but decided it cannot be as that would mean the green ALS has 2 cells with 4 candidates (2457)

This example needs to show the 2 sets (blue and green) before the removal of 7 from the grey cell.
1 November 2015
by John
RE: Comments and feedback for almostLockedSets

If a five was placed in R9C9 it would indeed lock both sets. In this case the four would have to be used in both cells labeled with a B and this would not be allowed. The five can also be eliminated from R9C9 based on the 2 Almost Locked Sets in this example.

While this example also shows using a four in the grey cell, means there will be 2 fives in box nine, this is not always the case with Almost locked Set logic.
30 October 2015
by Dave
RE: Comments and feedback for almostLockedSets

The 5 in row 9 column 9 would lock both of the sets. The 4 that has been labeled removed causes both the locked sets to have a 5 in the same box. The logic is different because the 4s are not in the same unit.
21 February 2014
by John
RE: Comments and feedback for almostLockedSets

I do believe so. In this particular example you could exchange the logic for 4s and 5s and make that elimination.
20 February 2014
by Rafael Scheffer
RE: Comments and feedback for almostLockedSets

Can I assert that candidate 5 can be removed from row 9, column 9, by this rule, considering it's the restricted common candidate and must exist only in one of the two sets...

* Feedback
* Enter the letters from the CAPTCHA image.
* Required Input
To submit this form, enter the letters you see on the red CAPTCHA image in the box next to the image. If you cannot read the image click 'New CAPTCHA' to get a different CAPTCHA image.

Using CAPTCHA verification on a web site helps reduce SPAM and web site abuse by making it harder for other computers to automatically access pages on this website.
Sudoku Rules and Techniques

Sudoku Rules

Acknowledgments

I would like to acknowledge these sites referenced for strategy ideas and solving techniques.

SudokuWiki.Org by Andrew Stuart
PaulsPages.co.uk by Paul Stevens