You are on page 1of 22

# HoDoKu: Solving Techniques - Chains and Loops

http://hodoku.sourceforge.net/en/tech_chains.php

Chains and Loops
Introduction What is a Chain? Links and Inferences Group Links ALS in Chains Chains versus Nets Notation Displaying Chains in HoDoKu Remote Pair X-Chain XY-Chain Nice Loop/AIC Nice Loop Propagation Rules Discontinuous Nice Loop Alternate Inference Chains Type 1 Alternate Inference Chains Type 2 Continuous Nice Loops/AIC Loops Grouped Nice Loop/AIC Group Nodes Only Group Nodes and ALS

Introduction
What is a Chain?

1 of 22

12/3/2012 9:37 PM

HoDoKu: Solving Techniques - Chains and Loops

http://hodoku.sourceforge.net/en/tech_chains.php

The basis of all chains are two types of basic implications, normally called "links" or "inferences" (in this guide the term "link" is used as synonym for both).

If two entities are weakly linked, they cannot be true at the same time. That means: If one of them is true, then the other has to be false (but both can be false as well, so if one is false, nothing can be concluded). In simple chains the entities are normally simply candidates, that share a house or a cell.

Group Links form inferences between more than two candidates. Normally we use only two candidates to form a link: If they are the only instances within their house, they are strongly linked, if there are other instances left, they are weakly linked. If we consider intersections between houses as well, we can build a slightly more advanced type of link. Consider the example below (taken from Locked Candidates):

2 of 22

12/3/2012 9:37 PM

one of r3c12 has to be 5 (grouped strong link) As with any strong link they can form a weak link too: If one of r3c12 is 5.net/en/tech_chains. neither r3c1 nor r3c2 can be 5 (grouped weak link) Links can exist between group nodes too as can be seen in the example below: 3 of 22 12/3/2012 9:37 PM . A strong link does exist in block 1 between r3c1 and r3c2 (only two instances of candidate 5 in block 1).sourceforge. a strong link cannot be built in row 3 (too many candidates). We can then make the following conclusions: If both r3c12 are not 5.HoDoKu: Solving Techniques .php Look at candidates 5 in row 3 (ignore the colors for now. but not between one of r3c12 and r3c7. Any two of those candidates are weakly linked. 2. r3c7 has to be 5 (grouped strong link) If r3c7 is not 5. a Group Node. That changes. We have three instances of candidate 5 in that row (columns 1. if we consider r3c12 as one node.Chains and Loops http://hodoku. r3c7 cannot be 5 (grouped weak link) If r3c7 is 5. they are from the Locked Candidates move). and 7).

Remote Pairs can be replicated by one or two Simple Color moves.HoDoKu: Solving Techniques .sourceforge. It considers only bivalue cells that contain the same two candidates. To eliminate something.php Remote Pair is the simplest chaining technique. Since the cells are bivalue.net/en/tech_chains. The Remote Pair ensures. The links between the cells can therefore be weak (the cells have to see each other). a strong link exists within every cell between the two candidates. 6 of 22 12/3/2012 9:37 PM .Chains and Loops http://hodoku. Any cell outside the Remote Pair that sees two cells with different values cannot have one of the Remote Pair digits set. that any cell within the chain has the opposite value of the cell before it. the chain has to be at least four cells long.

All cells that see Remote Pair cells with opposite polarity can be neither 2 nor 8. The important thing with X-Chains is. The chain is 8 cells long. The example on the right starts with r7c8 and ends with r8c4. r6c1 is 4.php Example on the left: If r2c7 is 5. In other words: If r2c7 is 5.net/en/tech_chains. r3c1 must be 5 as well and r2c2 and r6c1 must be 4 or vice versa. Any cell that sees those two cells (in the example r6c7) can be neither 4 nor 5.HoDoKu: Solving Techniques . or Empty Rectangle).sourceforge. if r2c7 is 4. X-Chains of length 4 are sometimes called Turbot Fishes and can be found using the appropriate Turbot variants (Skyscraper. This ensures that one of the endpoints actually contains the chain digit. 7 of 22 12/3/2012 9:37 PM . that they have to start and end with a strong link. r6c1 is 5 (the cells r2c7 and r6c1 have opposite polarity). 2-String Kite. X-Chain X-Chains are chains that use one digit only.Chains and Loops http://hodoku. That digit can be removed from any cell that sees both ends of the chain.

8 of 22 12/3/2012 9:37 PM .HoDoKu: Solving Techniques . and r1c2 has to be 7. r1c9 cannot be 7.Chains and Loops http://hodoku. that either r4c2 or r6c5 is 3. r4c2 sees both cells and can't be 7 as well. If on the other hand r4c3 is not 7.php On the left: If r1c2 is not 7. r7c3 cannot be 7 and r4c3 has to be 7. Conclusion: One of r1c2 and r4c3 must be 7. 3 can be eliminated from r6c123. r7c8 has to be 7.net/en/tech_chains. then r7c3 has to be 7. r2c8 cannot be 7. r2c8 has to be 7. On the right: The X-Chain proves. r1c9 has to be 7. r7c8 cannot be 7.sourceforge.

php XY-Chain An XY-Chain is a chain that uses only bivalue cells (similar to Remote Pairs).sourceforge. The only restriction (besides the obvious necessities for the links) is.Chains and Loops http://hodoku. but the cells can have arbitrary candidates. As with Remote Pairs all strong links are within the cells.HoDoKu: Solving Techniques . and it can be eliminated from all cells that see both ends of the chain. As with X-Chains this proves that one of the endpoints must have that candidate placed. 9 of 22 12/3/2012 9:37 PM .net/en/tech_chains. that the XY-Chain starts and ends with a strong link on the same digit. all weak links are between the cells.

Example on the left: r1c8 -7. it is discontinuous.r4c9 -5.sourceforge.php the loop is continuous. The loop starts with a weak link on 7 (the initial 11 of 22 12/3/2012 9:37 PM .r4c8 =5= r1c8.r7c9 -4.Chains and Loops http://hodoku.HoDoKu: Solving Techniques .net/en/tech_chains.r7c8 -8. Discontinuous Nice Loop If the loop closes with a contradiction. The effects can best be seen using the examples below.

13 of 22 12/3/2012 9:37 PM . What's special here is that one of the eliminated candidates (6 in r2c7) is actually part of the chain.r2c5 -7.r1c2 -3.r2c7 =6= r3c8 -6. The AIC is called cannibalistic. Either r1c2 or r8c3 is 5.php On the left: 5.r8c3 -5. Alternate Inference Chain Type 2 An AIC Type 2 starts and ends on a strong link for two different digits in two cells. On the right: 6. That is perfectly legal.net/en/tech_chains. This proves that the end digit can't be in the start cell and the start digit cannot be in the end cell. that see each other. so none of r123c3.r1c4 =3= r3c4 =9= r7c4 =2= r7c2 -2.HoDoKu: Solving Techniques .r2c1 =7= r6c1 =6= r6c7 -6.Chains and Loops http://hodoku.r78c2 can be 5.sourceforge.

php On the left: 4.Chains and Loops http://hodoku.r6c2 =4= r9c2 -4. r6c4 cannot be 4 either. We have a verity that proves.HoDoKu: Solving Techniques .r1c7 =2= r6c7 =6= r6c3 =5= r4c2 =2= r4c8 -2. because the cells see each other.net/en/tech_chains. We start with 4 in r6c2 and end with 8 in r6c4. 4 cannot be in r6c4 and 8 cannot be in r6c2.sourceforge. 2 cannot be in r1c8 and 8 cannot be in r4c8.r9c5 -9. that r6c4 cannot be 4.r1c8 -2.r5c5 =9= r5c4 =8= r6c4 -8. 14 of 22 12/3/2012 9:37 PM . which means r6c4 cannot be 4. But if r6c2=4. Prove for candidate 4: If r6c2<>4 then r6c4=8. On the right: 8.

or put in another way. but if present.php Continuous Nice Loops (AIC Loops) Continuous Nice Loops and AIC Loops are exactly the same thing. if no contradiction occurs in the start/end cell.Chains and Loops http://hodoku. 15 of 22 12/3/2012 9:37 PM .sourceforge. A loop is continuous. They occur not as often as Discontinuous Loops. What makes Continuous Nice Loops so effective is that all weak links in the loop are converted into strong links.HoDoKu: Solving Techniques . That means that all additional candidates in the houses or cells providing the weak links can be eliminated. if the link back to the original cell plus the first link obey the propagation rules. they usually are very effective.net/en/tech_chains.

Cell r7c6 is left on a strong link on 2 and reached again on a strong link on 5 (first propagation rule).php Example on the left: 5= r7c6 =2= r6c6 -2. and last but not least weak link between 3 and 5 in r8c6 (eliminates 8 in that cell). The eliminations: The first weak link is within the start cell between candidates 2 and 5.Chains and Loops http://hodoku. all rules for building AICs are complied with. r8c4 and r7c4. The next weak link is in block 5 between 2 in r6c6 and 2 in r4c5.r3c3 =7= r1c3 =5= r1c6 -5.net/en/tech_chains.r4c5 -3. that the latter use group links.r8c5 =3= r8c6 =5= r7c6 =2. Example on the right: 9= r7c5 =1= r7c9 =7= r3c9 -7. all other candidates in that cell can be eliminated (6 and 8).HoDoKu: Solving Techniques . 16 of 22 12/3/2012 9:37 PM . r7c9. all other candidates 2 in block 5 can be eliminated.sourceforge. Next weak link on candidate 3 in column 5 (eliminates 3 from r26c5). r1c3. A weak link exists between candidates 2 and 5 in cell r7c6. Weak links within cells are in r7c5. Weak links between cells are in row 3 (nothing to eliminate) and column 6.r8c6 =5= r8c4 =7= r7c4 =9= r7c5 =1. Grouped Nice Loop/AIC Group Nodes Only The only difference between (normal) Nice Loops/AICs and Grouped Nice Loops/Grouped AICs is.

On the right: Grouped Continuous Nice Loop 2= r6c4 =1= r6c3 -1. then neither r7c3 nor r9c3 can be 2.r78c4 =2= r6c4 =1. For the second group link: If r5c3 is 2. 17 of 22 12/3/2012 9:37 PM .sourceforge.Chains and Loops http://hodoku.HoDoKu: Solving Techniques .php On the left: Grouped Discontinuous Nice Loop r7c1 =2= r2c1 -2.r5c3 -2. The two group links are for candidate 8 in cells r13c4 and for candidate 2 in r79c3.r5c4 -3.net/en/tech_chains. that means that r5c3 cannot be 8. that means that r7c1 has to be 2. The logic for the first group link goes as follows: If r1c5 is not 8 then either r1c4 or r3c4 has to be 8.r2c5 =2= r1c5 =8= r13c4 -8.r9c3 =1= r9c9 =2= r9c56 -2.r79c3 =2= r7c1.

r7c2 -6. The logic: If r9c9 is not 2.r6c2 -3. The weak link between the group nodes r9c56 and r78c4 occurs in block 8 and eliminates all other candidates 2 from that block.Chains and Loops http://hodoku.net/en/tech_chains. On the left: Grouped AIC 5.HoDoKu: Solving Techniques .r6c4 -7. then either r9c5 or r9c6 has to be two. that means that neither r8c4 nor r7c4 can be 2 and it follows that r6c4 has to be 2.php The group links are both on candidate 2: Intersection of row 9 with block 8 (r9c56) and intersection of column 4 with block 8 (r78c4).r9c6 -5 (group link on 7 in r45c5 - 18 of 22 12/3/2012 9:37 PM .r45c5 =7= r3c5 =6= r3c6 -6.sourceforge.

subtract the candidates used to enter and to leave the ALS (they are normal weak links that become strong links as usual in continuous loops).r89c8 =1= r2c8 -1. making the chain cannibalistic.r2c456 =1= r1c4 -1. Almost Fish. ALS nodes in Grouped Continuous Nice Loops are especially interesting: If we take all ALS candidates. the remaining candidates become locked within the ALS cells and can provide eliminations in all cells. To see such chains.2. This doesn't form a loop: A group node is not the same as a simple node. Group Nodes and ALS If we allow ALS as nodes in chains and loops. can be nodes as well).net/en/tech_chains. Please note that this possible only in continuous loops. things get really interesting (and it does by no means stop there: AURs. 19 of 22 12/3/2012 9:37 PM . One of them (r2c456) has three cells (the maximum for a group link).php same logic as above). the appropriate option has to be enabled in HoDoKu (starting with release 1.HoDoKu: Solving Techniques . However it leads to the elimination of one of the group link members.r2c5 =4= r9c5 -4. One of those cells happens to be the start cell.Chains and Loops http://hodoku.sourceforge. This example has two group links.r9c9 -1. On the right: Grouped AIC 4. etc. ALS nodes are disabled by default). that see all instances of one of the locked candidates within the ALS.

r7c12 =5= r7c5 =2= r8c5 -2. neither r7c1 nor r7c2 can be 5. we can squeaze a few more eliminations out of it (not that it matters: the sudoku is solved after any of the two loops). 20 of 22 12/3/2012 9:37 PM .HoDoKu: Solving Techniques . The eliminations for candidate 2 each see one ALS cell as well. the weak link into the ALS (candidate 3) eliminates all other 3s from column 6. But the ALS has still one candidate left: candidate 8.r8c2. That reduces the ALS to a locked set on candidates {56} in r8c34. since this is our start cell. which would eliminate other 2s from row 6 if there were any. r7c5 has to be 5 and can't be 2. We start simple: If 5 is set in r8c2 (premise). The weak link contradicts the premise.r9c56 =2= r9c9 =3. If we allow ALS nodes. 5 can be eliminated from r8c2. it is the exit candidate. But r8c3 was the only candidate 2 in the ALS r8c34 {256}. On the right: The sudoku is the same as for our Grouped Continuous Nice Loop example above. but they are cannot be eliminated by the ALS: Firstly each cell would have to see all instances of canddiate 2 within the ALS and secondly 2 is not locked within the ALS. We are only interested in r8c2. Possible eliminations by that Locked Set (and thus possible weak links for our chain) are 5 in r8c2 and r8c5 and 6 in r8c6. r8c5 has to be 2 and r8c3 cannot be 2. The loop: Grouped Continuous Nice Loop 2= r9c9 =3= r9c6 -3.ALS:r8c34 -5.php On the left: Grouped Discontinuous Nice Loop r8c2 -5. The ALS is left using candidate 2. It gets locked within the ALS cells r6c56 and eliminates 8 from all cells that see both those cells (8 eliminations total).sourceforge.Chains and Loops http://hodoku. The weak link within cell r9c9 eliminates candidate 1.net/en/tech_chains.ALS:r6c56 -2.r6c4 =2= r78c4 -2. The 2s are eliminated by the weak link between group node r78c4 and group node r9c56 (both in block 8).

sourceforge.r8c89. On the right: Grouped AIC 6. This one is interesting. because it shows a forcing by an 21 of 22 12/3/2012 9:37 PM .r6c4 -4.r7c1 -8.r9c4 -9.r8c6 -3.ALS:r78c7.r9c8).Chains and Loops http://hodoku. This is nothing new.ALS:r29c3 =6= r5c3 -6.HoDoKu: Solving Techniques .r9c8 -6.r8c89. only the ALS is fairly large: 6 candidates ({123469}) in 5 cells (r78c7.php Finally two examples of AICs with ALS nodes: On the left: Grouped AIC 4.net/en/tech_chains.

php ALS node. 22 of 22 12/3/2012 9:37 PM .3. The ALS is r29c3 {189}.net/en/tech_chains. leaving 6 as only candidate in that cell.Chains and Loops http://hodoku. A more complete notation would be: 6.ALS:r29c3 -19. the chain is written as shown above.HoDoKu: Solving Techniques . Since HoDoKu currently doesn't support links on more than one candidate. thus forcing it. It is reached via candidate 8 in r9c3. The next node r5c3 has candidates {169}: 1 and 9 are eliminated by the Locked Set.r5c3 -6 (the ALS has to be reached and left on a weak link).r7c1 -8. which leaves the locked pair {19}.sourceforge. Copyright © 2008-12 by Bernhard Hobiger All material on this page is licensed under the GNU FDLv1.