Solver App for Android and iPhone
Strategies for Number Puzzles of all kinds
Page Index
Solvers
Puzzles
Basic Strategies
Tough Strategies
Diabolical Strategies
Extreme Strategies
Depreciated Strategies
Str8ts
Other

Aligned Pair Exclusion

This is an interesting strategy, known by the short-hand as APE and sometimes called Subset Exclusion. It can overlap with Y-Wings, XYZ-Wings and WXYZ-Wings but uses very different logic. The overlap is not strict so they are worth looking out for in a tough situation.

There is always a base pair of cells (which now show up as grey cell on the solver). At least one elimination will occur in one of those two cells. The solver will also show a variety of colored cells which are the elements used to make an elimination. I used to distinguish between APE type 1 which only used bi-value cells and type 2 which used 2-cell Almost Locked Sets (ALSs). But the solver will now find a larger variety including 3-cell ALSs and since these merely extend the same logic the solver will return the first of any it finds. A better Type 1 and Type 2 distinction is between the base pair of cells which can be a locked pair (ie can see each other) or not (can't see each other). The logic is subtly different but I'll come to this in the following examples.

Aligned Pair Exclusion - Type 1

APE example 1 (requires Y-Wing unchecked)
APE example 1 (requires Y-Wing unchecked) : Load Example or : From the Start

The Aligned Pair Exclusion can be succinctly stated: Any two cells that can see each other CANNOT duplicate the contents of any Almost Locked Set they both entirely see and share candidates with.

Remember - a bi-value cell (with two candidates) is the simplest Almost Locked Set since it is a set of size '1' with size+1 (ie two) candidates.

Let's consider the simplest possible example - two bi-value cell attacking the pair. I have also shown the Y-Wing in the diagram so we can see there is a simpler way to do the same job - but only in some cases.

We consider ALL the possible pairs of numbers that will fit in [G2/G3]. These are for G2 and G3:

2 and 2 (impossible)
2 and 5
2 and 8
4 and 2
4 and 5
4 and 8

Apart from the first being impossible (2 and 2) since G2 and G3 can see each other, we have problems with some of the other combinations. What if 2 and 8 were tried as the solutions? Well, that would duplicate and therefore empty G9. Also 4 and 8 would empty H8.
We are left with a set of combinations that looks like this:

2 and 2 (impossible)
2 and 5
2 and 8 (impossible)
4 and 2
4 and 5
4 and 8 (impossible)

Notice that we now have no 8 left in any pairing? Therefore we can remove 8 from our base pair. Voilà

Credits - Rod Hagglund first popularised this method. (links now dead).

Example 2

APE example 2
APE example 2 : Load Example or : From the Start
The next example a tri-values spread over two cells as part of the attack. The way we can use double cells is by saying that any two cells with only abc excludes combinations ab, ac and bc from the base pair under consideration. This neat trick greatly extends the usefulness of APE which would otherwise be a just poor man's Y-Wing.

The 2-cell ALS in [A1,B3] contains {1/3/7} so pairs that would cripple the solution for that ALS are {1,3}, {1,7} and {3,7}.

Let's consider all the possible pairs of numbers in our base pair [C2/C3]. These are:

1 and 3 - excluded by A1 + B3
1 and 4 - excluded by C5
1 and 9
3 and 3
3 and 4
3 and 9
8 and 3 - excluded by C9
8 and 4
8 and 9


Now, we have to be a tiny bit careful here. 3 has definitely been excluded as a possible solution in C3 but look down the list and 3 + 4 is still OK and 3 + 9 is OK. So we can't remove 3 from C2 just yet.

Credits: Myth Jellies came up with the insight for abc = ab/ac/bc

Note: There could be more than two, sometimes three or four ALSs of several sizes in an APE attack. I've considered examples with two for simplicity's sake


Example 3

APE Example 3
APE Example 3 : Load Example or : From the Start
Further into the same puzzle we come across a 3-cell ALS plus a bi-value in H3 attacking A3/B3. The ALS in [A1,C1,C3] contains the four numbers {1,4,7,9} which the solver thinks of as a quadruple combination. The combinations of 'abcd' are ab, ac, ad, bc, bd and cd. Back to the base pair: We can list the combinations for A3/B3 as

4 and 3
4 and 7 - excluded by [A1,C1,C3]
5 and 3
5 and 7 - excluded by H3
7 and 3
7 and 7 (impossible)

The tricky one with the 3-cell ALS is not the fact that the base pair will empty it (it can't since it is two cells and the ALS is 3 cells). It's the fact that a solution of 4 in A3 and 7 in B3 would mean there'd be only two candidates left to fill three cells. Thats enough to rule out the combination.

Aligned Pair Exclusion - Type 2

Aligned Pair Exclusion can also work even if the pair is not aligned. Sounds like a joke, but it's too late now to rename this strategy :) Perhaps 'Subset Exclusion' was a better idea. There is a subtle logical different but I have found many examples and it boosts the usefulness of this strategy.
I'm very grateful to Joseph Aleardi for putting me on the scent of this elegant logic.

APE Example 4 (turn off Y-Wings)
APE Example 4 (turn off Y-Wings) : Load Example or : From the Start
The simplest type of APE2 using just two bi-value cells duplicates the Y-Wing, but I include an example to illustrate how APE2 works.

The diagram here shows first the Y-Wing based on A1 - A4 (the pivot) - B6. It's quite easy to see that 8 must occur in either A1 or B6, thus removing it from B1 and B2.

But let's follow the APE logic with the non-aligned pair A4 and B1. (Note: We could also choose A1 and B2 and eliminate the 8 there also). A4 pairs with B1 using these combinations:

1 and 1 - POSSIBLE!
1 and 6
1 and 8 - excluded by A1
9 and 1
9 and 6
9 and 8 - excluded by B6

The only difference between APE 1 and APE 2 is that with non-aligned pairs the same candidate *could* be a solution in both cells. So 1 and 1 is definitely on the cards. Not that it is critical in this case. The other exclusions mean we can't have an 8 in B1, just as we thought.

APE Example 5
APE Example 5 : Load Example or : From the Start


Here is a more complex APE that does not have a Wing alternative. We have two bi-value cells and one two cell ALS attacking B1 and C7. Let's write out the combinations between those cells:

1 and 4 - excluded by B9
1 and 5 - excluded by B8
1 and 7 - excluded by [C1 + C3]
2 and 4
2 and 5
2 and 7
7 and 4
7 and 5
7 and 7 - Permitted!

Clearly 1 is removed from B1. The exact same formation also removes 1 from B2.
APE Example 6
APE Example 6 : Load Example or : From the Start


To conclude, a non-aligned pair using a bi-value cell and a 3-cell ALS. I'll leave it to the reader to work out why 6 can be removed from D1.

There is a second very nice APE later in the solving sequence using a 2-cell ALS and a 3-cell ALS. You can load the puzzle from the links under the diagram.

An Eight-Cell Aligned Pair

An Eight-Cell Aligned Pair
An Eight-Cell Aligned Pair : Load Example or : From the Start
I love to end these articles with a Sudoku from Klaus Brenner. He has made finding interesting and beautiful examples an art form and in the case of Aligned Pairs has found what we thought was impossible. An eight-cell Aligned Pair elimination! We had found some five-cell examples and wondered if there could be a six-cell or even a seven-cell. This is the first and only eight-cell formation known. Fortunately the solver can handle this many. Each cell is necessary to produce all the pairs used to cross reference with the target cells in D5 and E5 - the solver ignores any other ALSs that are not used. And very pretty it is.

How many difficult puzzles did Klaus have to check to find this? Astonishingly, around 21 million!
Go back to Pattern OverlayContinue to Empty Rectangles


Comments

Your Name/Handle

Email Address - required for confirmation (it will not be displayed here)

Your comment or question

Please enter the
letters you see:
arrow
Enter these letters Remember me


Please keep your comments relevant to this article.
Email addresses are never displayed, but they are required to confirm your comments. When you enter your name and email address, you'll be sent a link to confirm your comment. Line breaks and paragraphs are automatically converted - no need to use <p> or <br> tags.
Comments Talk

Saturday 18-Oct-2014

... by: Stefan

Example 1 states 4 and 8 would empty H8 when H1 is what is intended and depicted.

Tuesday 22-Jul-2014

... by: rRcCV

Like your site very much.
But I would appreciate to get some help in understanding the last "Eight-Cell Aligned Pair" example.
As far as I can see eliminating candidate 2 from E5 just requires four of the eight cells:
B5, C5, D6 and E6.
And completing the exercise of checking all possible combinations in D5E5 against the impact of all the ALS highlighted in the diagram unveals a lot of other combinations as being impossible, but they are not enough to eliminate any candiates from either D5 or E5, since I#m left with the remaining combinations as follows:
1 7
2 4
6 9
7 9
9 7
So what's the benefit of taking EF4 and HJ5 into consideration?
I just don't see what makes the statement true that "Each cell is necessary to produce all the pairs used to cross reference..."
Thanks for any explanation.

Monday 10-Mar-2014

... by: Anton Delprado

I think it is important to note that any ALS seen by both cells doesn't have to be entirely seen by both cells.

For example if we were excluding "3 and 5" then the first cell only has to see the cells in the ALS that can be 3 and the second cell only has to see the cells in the ALS that can be 5.
Andrew Stuart writes:

Correct

Monday 25-Jun-2012

... by: ad.joe

General structure of the APE
------------------------------------
Maybe it's not easy to put this straight, but in fact there are eliminations in 2 boxes:

g k p | _ _ _ | Y Z _
_ _ _ | _ _ _ | _ _ _
_ _ X | _ _ _ | a b c

The "wings" are X=2#, Y=2*, Z=2+

Then XYZ eliminates 2 on the aligned cells abcgkp ...

(provided that these have "not much more than #*+ on it", so you have to "cross-check")

- Doesn't the APE-structure look like an xy-wing (y-wing)? Only the function does work backwards and there is no pivot necessary!!
So you could also call it a BACKWING or a BACKSWING!

- And of course, in an X-Sudoku the 2 aligned fields need not be in the same box
(as long as one of the two is on a diagonal).

Friday 22-Jun-2012

... by: ad.joe

How to tease out the APE:
-----------------------------------
First, it's not our job to solve one of the examples in another way. But it's nice that all is so understandable.
(Matt, I'd add three words: duplicate the contents of any "ONE of the" two-candidate cells they both see. )
So, as we look for the third cell of an xy-wing (having seen two "similar" ones at first), what can we do here:
Let's solve it by cross-checking: We assume that the most FREQUENT number of the bivalue cells can be eliminated in the two cells in question.
We assume this number being correct there and quickly end in error, quicker than in looking up all combinations.
(Who'd think that we would not score more than 90 percent, he/she can feel free to try with the other numbers)

Sunday 18-Dec-2011

... by:

I want this software. how I can have it?
Andrew Stuart writes:

See Sudoku Solver for Mobile Devices

Monday 8-Feb-2010

... by: Phil Gooda

I actually managed to understand all this, except for one thing......why bother, there is a far simpler soultion within that box? Let me demonstrate by considering ONLY that box and naming the cells as follows:

A B C
D E F
G H I ..... which means that my C is the X mentioned, and my F is the Y mentioned.

Cells B, C and G contain 3 numbers and only 3 numbers between them. Therefore those 3 numbers cannot appear in the other cells. Which immediately gives you the paired 5/9 in F and I, which means that E has to be 4. Why bother doing all the APE stuff?

Monday 25-Jan-2010

... by: Patrick Barnaby

An XY-Chain removes 7 from r8c8. A Bilocation Graph reveals a 2 at r7c2 and then you'll have a naked 7 and then a naked 8 and then quite a few hidden singles on the first and second rows. So this is easier than APE except the Bilocational graph techinque.

Thursday 12-Nov-2009

... by: Matt Lala

I love the site but some of the explanations need help. Or I guess I do. I think this is one of the less clear ones.

The rule you have says:
Any two cells aligned on a row or column within the same box CANNOT duplicate the contents of any two-candidate cell they both see.

If I take that literally in the first example... X in the first example can see the bivalues 25 and 37. It cannot duplicate the contents of those cells. Therefore... it can't be 2,5,3 or 7? Obviously that's not what was meant.

Or is it... if the two aligned cells see some bivalue cells, and they both mutually share a certain candidate [that's part of those bivalue cells] then that shared candidate can go? But no, that's not it either.

If either if the cells see two bivalue cells, and those two bivalue cells both share a candidate with the cell under consideration... that shared one goes?

Does one actually have to enumerate the possibilities? This seems like something that can be spotted with a glance, if only it can be made clear the exact conditions needed.

Wednesday 30-Sep-2009

... by: Bernard Gervais

align pair type 2
I found more than one numerical solution for this example.
Best regards.
BG

Wednesday 30-Sep-2009

... by: Bernard Gervais

Excellent site, thank you.
for example 1, I use the unicity concept which pinpoints A4 = 1.
Best regards.
Article created on 11-April-2008. Views: 80208
This page was last modified on 9-November-2013.
All text is copyright and for personal use only but may be reproduced with the permission of the author.
Copyright Andrew Stuart @ Syndicated Puzzles Inc, 2013