Colouring question

Advanced methods and approaches for solving Sudoku puzzles

Colouring question

Postby pjaj » Fri Feb 03, 2006 5:31 pm

I use SadMan Sudoku to set me problems.
Recently I thought I'd cracked colouring and can usualy solve most problems that don't need forcing chains, this includes the following problem rated as "fiendish".

Code: Select all
+----------------+----------------+----------------+
|           3    | 5    1         |      8         |
| 8              | 6              | 4              |
|      1    9    |                |                |
+----------------+----------------+----------------+
|      8         |           5    |      2         |
|           5    |      6         | 1              |
|      3         | 4              |      6         |
+----------------+----------------+----------------+
|                |                | 3    1         |
|           4    |           2    |           6    |
|      6         |      5    9    | 8              |
+----------------+----------------+----------------+


I got stuck at this position:

Code: Select all
+----------------+----------------+----------------+
| 6    47   3    | 5    1    47   | 2    8    9    |
| 8    257  27   | 6    9    3    | 4    57   1    |
| 457  1    9    | 28   27   478  | 6    3    57   |
+----------------+----------------+----------------+
| 1    8    6    | 9    3    5    | 7    2    4    |
| 47   247  5    | 28   6    78   | 1    9    3    |
| 9    3    27   | 4    27   1    | 5    6    8    |
+----------------+----------------+----------------+
| 25   9    8    | 7    4    6    | 3    1    25   |
| 3    57   4    | 1    8    2    | 9    57   6    |
| 27   6    1    | 3    5    9    | 8    4    27   |
+----------------+----------------+----------------+

and went for a hint and got

Colouring 7: double exclusion found, eliminating 7 from r1c2,
(r1c6 => r3c5 => r3c9 => r9c9 => r9c1 => r8c2)

But this does not seem correct, how can r1c6 => r3c5 when r3c6 also
contains a 7 in the same block?

Similarly how can r3c5 => r3c9 when r3 contains 4 possible 7s?

Am I missing something, or has SadMan thrown a cog?
pjaj
 
Posts: 4
Joined: 03 February 2006

Postby MCC » Fri Feb 03, 2006 6:00 pm

Hi pjaj

I'm not to sure about the colouring but I'm sure someone will explain.

In the meantime:

Code: Select all
+----------------+----------------+----------------+
| 6    47   3    | 5    1    47   | 2    8    9    |
| 8    257  27   | 6    9    3    | 4    57   1    |
| 457  1    9    | 28   27   478  | 6    3    57   |
+----------------+----------------+----------------+
| 1    8    6    | 9    3    5    | 7    2    4    |
| 47   247  5    | 28   6    78   | 1    9    3    |
| 9    3    27   | 4    27   1    | 5    6    8    |
+----------------+----------------+----------------+
| 25   9    8    | 7    4    6    | 3    1    25   |
| 3    57   4    | 1    8    2    | 9    57   6    |
| 27   6    1    | 3    5    9    | 8    4    27   |
+----------------+----------------+----------------+

If r8c2=7=>r1c2=4
If r8c2=5=>r2c2<>5=>r2c23(naked pair)=>r1c2<>7=>r1c2=4
Therefore r1c2=4

MCC
MCC
 
Posts: 1275
Joined: 08 June 2005

Re: Colouring question

Postby Jeff » Fri Feb 03, 2006 6:17 pm

pjaj wrote:I use SadMan Sudoku to set me problems.
Recently I thought I'd cracked colouring and can usualy solve most problems that don't need forcing chains.........

Welcome to the forum, Pjaj.:)

Firstly, all colouring deductions can be expressed as forcing chains. It is easy to understand colouring through forcing chain; but not easy the other way around.

There are 4 types of colourings, namely:

Type 1: Colouring with pure conjugate links on a filtered digit.
Type 2: x-cycle type colouring on a filtered digit.
Type 3: Advanced colouring involving all 9 digits.
Type 4: Grouped colouring on a filtered digit (grouped x-cycle).

SadMan Sudoku uses the term "simple colouring" to collectively describe both type 1 and 2. The colouring deduction hinted by SadMan Sudoku is type 2. With type 2 colouring, only alternative links are required to be conjugate links. I think your understanding with colouring is up to type 1.
Jeff
 
Posts: 708
Joined: 01 August 2005

Postby pjaj » Fri Feb 03, 2006 8:10 pm

Thanks Jeff and MCC. I guess I didn't understand colouring as well as I thought I did:!::(
I must now go away and find more information on Types 2,3 and 4.
There are some interesting articles on SadMan's links page

http://www.simes.clara.co.uk/programs/sudokulinks.htm

including a link to this group of forums.

As for forcing chains, well they are still a black art to me, but I've noticed a thread in this forum that looks very promising, so I'm off to read it.
pjaj
 
Posts: 4
Joined: 03 February 2006

Postby JeffInCA » Sat Feb 04, 2006 7:34 pm

pjaj,

I haven't really gotten my mind around coloring based on cycles yet either; however, there are many coloring-based eliminations that can be made based on what I consider easier coloring techniques, and with these you can quickly arrive at a solution

One semi-advanced coloring technique is called Multi-Colors by Simple Sudoko, which I believe simply refers to the fact that more than one conjugate chain is colored at the same time and the deductions are made accordingly.

Here's a great post by angusj on this subject

http://www.setbb.com/phpbb/viewtopic.php?p=2575&mforum=sudoku#2575

Back to your puzzle, coloring on ths 7s in this sudoku yields the following:

Code: Select all
 .  7C .  | .  .  7c | .  .  . 
 .  7  7B | .  .  .  | .  7a . 
 7  .  .  | .  7b 7  | .  .  7A
----------|----------|-----------
 .  .  .  | .  .  .  | .  .  . 
 7  7  .  | .  .  7b | .  .  .
 .  .  7b | .  7B .  | .  .  . 
----------|----------|-----------
 .  .  .  | .  .  .  | .  .  .
 .  7a .  | .  .  .  | .  7A .
 7A .  .  | .  .  .  | .  .  7a


1) Take a look at the 7 in r3c1.

We can see that it is in the same row as the 7 at r3c5 (7b), and in the same box as the 7 at r2c3 (7B). Since r3c5 and r2c3 are opposite colors, one of them must be 7 so we can eliminate 7 as a candidate for r3c1.

2) Now take a look at aboxes 1 and 2

This is an example of what angusj calls Type 2b multi-coloring in the post I linked to above.

r1c2 (7C) and r2c3 (7B) cannot both be 7, therefore either B or C is false. This means that either 'b or 'c' must be true. Hence, one of r1c6 (7c) or r3c2 (7b) must be true. As a result, r3c6 must not be 7 and 7 can be eliminated here.

Note that the exact reverse logic can be used to eliminate 7 in r2c2. (And in fact it also eliminates 7 from r3c1 as well, even though we already did that in 1) )

3) Now that we've made some eliminations, we can recolor the 7s using only one conjugate chain as follows:

Code: Select all
 .  7- .  | .  .  7+ | .  .  . 
 .  .  7+ | .  .  .  | .  7- . 
 .  .  .  | .  7- .  | .  .  7+
----------|----------|-----------
 .  .  .  | .  .  .  | .  .  . 
 7- 7  .  | .  .  7- | .  .  .
 .  .  7- | .  7+ .  | .  .  . 
----------|----------|-----------
 .  .  .  | .  .  .  | .  .  .
 .  7- .  | .  .  .  | .  7+ .
 7+ .  .  | .  .  .  | .  .  7-


From this we can see that in box 4, 7- appears twice (in r5c1 and r6c3). Since both of these cells cannot be 7, then '-' must represent the false condition and thus 7 can be eliminated from all cells marked '7-'. and conversely, all '7+' cells can be set to 7.

From here the puzzle solution is trivial.

In my opinion coloring can be an extremely powerful technique and you really only need to understand simple coloring on one chain and the multiple chain techniques outlined by angus, both of these just filtering on a single digit. With this coloring along with understansing x-wing, swordfish, and xy-wing, I've been able to solve all but the most difficult of puzzles.

If you haven't checked it out yet, Simple Suduko has a really nice interface for coloring and filtering on a single digit.

Cheers,

Jeff
JeffInCA
 
Posts: 33
Joined: 02 January 2006

Postby pjaj » Sun Feb 05, 2006 2:16 pm

JeffInCA that is a brilliantly clear explanation, thank you. Your link to the other post clarifies things nicely as well.
Although not strictly colouring I have found that, even with my limited ability:) , colouring can often help you spot an x-wing as the 4 cells involved are frequently picked up as two conjugate pairs.
pjaj
 
Posts: 4
Joined: 03 February 2006

Postby Havard » Sun Feb 05, 2006 4:03 pm

...or you could find the funky swordfish:

Image

and the nice skyscraper:

Image

and that would do exactly the same!:)

havard
Havard
 
Posts: 378
Joined: 25 December 2005

Postby TKiel » Sun Feb 05, 2006 5:20 pm

It appears to me that all the colouring exclusions can be made using only two conjugate chains, not three.

Code: Select all
 
 *--------------------------------------------------*
 | 6    47A   3   | 5    1    47a  | 2    8    9    |
 | 8    257  27B  | 6    9    3    | 4    57   1    |
 | 457  1    9    | 28   27   478  | 6    3    57   |
 |----------------+----------------+----------------|
 | 1    8    6    | 9    3    5    | 7    2    4    |
 | 47   247  5    | 28   6    78b  | 1    9    3    |
 | 9    3    27b  | 4    27B   1   | 5    6    8    |
 |----------------+----------------+----------------|
 | 25   9    8    | 7    4    6    | 3    1    25   |
 | 3    57   4    | 1    8    2    | 9    57   6    |
 | 27   6    1    | 3    5    9    | 8    4    27   |
 *--------------------------------------------------*

Since A & B share a group (Box 1) then both can't be true, which means either a or b is true and any cell sharing a group with them can be eliminated. This excludes the 7 in r3c6.

Recolouring with a single conjugate chain shows this
Code: Select all
*--------------------------------------------------*
 | 6    47A   3   | 5    1    47a  | 2    8    9    |
 | 8    257  27a  | 6    9    3    | 4    57   1    |
 | 457  1    9    | 28   27   48   | 6    3    57   |
 |----------------+----------------+----------------|
 | 1    8    6    | 9    3    5    | 7    2    4    |
 | 47   247  5    | 28   6    78A  | 1    9    3    |
 | 9    3    27A  | 4    27a   1   | 5    6    8    |
 |----------------+----------------+----------------|
 | 25   9    8    | 7    4    6    | 3    1    25   |
 | 3    57   4    | 1    8    2    | 9    57   6    |
 | 27   6    1    | 3    5    9    | 8    4    27   |
 *--------------------------------------------------*

which excludes the 7 in r2c2 and r3c1, since they share a group with both A & a.

The chain can then be lengthened
Code: Select all
 
 *--------------------------------------------------*
 | 6    47A   3   | 5    1    47a  | 2    8    9    |
 | 8    25   27a  | 6    9    3    | 4    57A   1   |
 | 45   1    9    | 28   27   48   | 6    3    57a  |
 |----------------+----------------+----------------|
 | 1    8    6    | 9    3    5    | 7    2    4    |
 | 47   247  5    | 28   6    78A  | 1    9    3    |
 | 9    3    27A  | 4    27a   1   | 5    6    8    |
 |----------------+----------------+----------------|
 | 25   9    8    | 7    4    6    | 3    1    25   |
 | 3    57   4    | 1    8    2    | 9    57   6    |
 | 27a   6   1    | 3    5    9    | 8    4    27A  |
 *--------------------------------------------------*

to make the exclusion of 7 in r5c1, because it shares a group with both A (r5c6) and a (r9c1), which solves the puzzle.

Tracy
TKiel
 
Posts: 209
Joined: 05 January 2006


Return to Advanced solving techniques

cron