Alternating Inference Chains (AIC)
Sudoku is fundamentally a logic puzzle. We use the Sudoku rules and the given digits on the board to deduce, through logical reasoning, what must go into the empty cells.
Propositions
In logic, a proposition is a statement that can be answered with true or false. In Sudoku, the simplest kind of proposition is “a certain digit is in a certain cell.” There are also broader propositions, such as “this digit is in one of these cells.”
For example, on the board above, “
If we look at column
By contrast, “
Propositions corresponding to given digits and answer digits are known to be true. For example, the
Each candidate also corresponds to a proposition, but its truth value is still undecided. If the proposition is proved false, we eliminate the candidate. If it is proved true, we promote the candidate to an answer digit.
Links
If two propositions can affect each other's truth value, then there is a link between them.
Using the same board, now focus only on candidate digit
So there is a link between the propositions “
Weak Links
This kind of relationship, where one proposition being true forces the other to be false, is called a weak link. Put differently, in a weak link at least one of the two propositions is false, or the two propositions cannot both be true.
Weak links are everywhere in Sudoku. Because a digit can appear only once in any house, two occurrences of the same candidate digit in the same row, column, or box are weakly linked. On the board above, for example, “
Weak links also exist between candidates in the same unfilled cell. A cell must contain exactly one digit, so any two candidates in that cell form a weak link. Here, we consider only cells with at least two candidates. A cell with no candidates indicates that the current board state is invalid, either because the puzzle itself is invalid or because an incorrect answer digit was placed earlier. If a cell has only one candidate, a single technique applies, and that candidate can be promoted to an answer digit.
In cell
Strong Links
The weak-link reasoning above starts from proposition
But the Sudoku rule “appears exactly once” means not only “at most once,” but also “at least once.” That gives us stronger and more useful links. On the same board, in box
Likewise, if an unfilled cell has only two candidates, those two propositions also form a strong link. For example, if cell
This kind of relationship, where one proposition being false forces the other to be true, is called a strong link. Put differently, in a strong link at least one of the two propositions is true, or the two propositions cannot both be false.
Note that every strong link is also a weak link, because it still satisfies the weak-link condition that if one proposition is true, the other is false. So whenever a solving technique requires a weak link, a strong link can be used there as well.
Link Diagrams
When discussing chain techniques, we often draw diagrams of links between propositions. In these diagrams, propositions are shown as small filled circles, also called nodes. A dashed line represents a weak link, and a solid line represents a strong link.
Eliminations with Strong and Weak Links
One important use of strong and weak links is candidate elimination.
If there is a strong link between two propositions, and a third proposition
As shown above, propositions
Returning to the earlier board:
We already saw that “
This specific case is exactly the Locked Candidates technique. In fact, the same logic also removes the
Bivalue Cells and Conjugate Pairs
The elimination logic above shows that strong links are the core of the reasoning, while weak links play only a supporting role. A strong link allows us to conclude that at least one of two propositions must be true; weak links can then be used to show that another proposition must be false.
So how do we find strong links? Whenever Sudoku imposes an “exactly one” condition and exactly two propositions can satisfy it, those two propositions form a strong link.
From the perspectives of cells and houses, the two most natural kinds of strong links are bivalue cells and conjugate pairs.
A bivalue cell is an unfilled cell with exactly two candidates. For example, if
A conjugate pair is a pair of positions for the same candidate digit
Grouped Nodes
Propositions do not have to be limited to the simple form “this digit is in this cell.” They can also be grouped, as in “this digit is in one of these cells.”
For example, on the board above, candidate digit
- Proposition
: is in one of , , or . - Proposition
: is in one of or .
Because box
Each of these propositions combines several simple propositions into one. For example, proposition
Alternating Inference Chains (AIC)
Earlier, we saw how strong and weak links can be used to eliminate candidates in simple situations. Things become much more interesting when these links form a chain that alternates between strong and weak.
In the diagram above, there are four propositions
We can keep extending the chain with alternating weak and strong links. As long as the chain starts and ends with strong links, the two end nodes will themselves behave as if they form a strong link.
This can be proved by a simple application of mathematical induction:
- The first two nodes are connected by a strong link.
- If we append one weak link and one strong link, the four-node chain again gives a strong link between its two ends.
- We can then treat only the two ends as a strong link, as in step 1.
- Repeat step 2.
So whenever strong and weak links alternate, and the chain begins and ends with strong links, the two end nodes act as a strong link. Such a chain is called an alternating inference chain (AIC). If some proposition
Depending on the structure and length of the chain, we get a rich set of Sudoku techniques:
- Same-Digit Two-Strong-Link Chains: these use the same candidate digit throughout, giving a chain of the form strong-weak-strong.
- Wings: these use bivalue cells at both ends, giving a chain of the form strong-weak-strong-weak-strong.