Re: Solving puzzles mechanically

Programs which generate, solve, and analyze Sudoku puzzles

Postby Guest » Mon Mar 28, 2005 12:23 pm

Hello Milobird,

Thank you for your hint, but I need some clarification please:

1. By column 6 do you mean (in the 'very hard' puzzle) the column with original clues of 148 or the column with original clues of 27? It all depends whether you number the first column as 0 or 1.

2. Am I looking for a purely logical solution where a deduction can be made immediately, or one of [partial] 'trial & error' in which I consider placing the 3 in different cells and then look for contradictions?

Please reply to this, as I think it may help to considerably enhance the Su Doku solver program I am currently writing.
Guest
 

Postby milobird » Mon Mar 28, 2005 12:31 pm

Hi Anthony,

I mean the column with clues 1,4,8.

You are looking for a purely logical step. I don't believe any of the Papocom puzzles require looking ahead for contradictions.
milobird
 
Posts: 21
Joined: 20 March 2005

Postby Guest » Mon Mar 28, 2005 6:52 pm

I don't see what you mean Milo. I have 4 undecided cells, with possibilities of (67) (367) (23) and (26) - I can't see any exclusive sets in there.

This is confirmed by showing that the 4 undecided cells can resolve in at least two ways, with the 3 in different spots:

6 7 3 6
&
7 3 2 6
Guest
 

Rules to solve Puzzle 94

Postby Guest » Sat Apr 02, 2005 6:24 am

I agree that the rules quoted are not in themselves sufficient. The log file below shows the logic that my solver program used.

The program starts (as others have) by listing all the available digit options for each unfilled cell (on a grid of 1-9, as row,col). As digits are chosen, this grid of 'allowed' digits is updated - hence the recursion on rule (1).

the steps are:-

1) choose any digits that are unique - this ia recursive unil exhausted
2) next look for digits that are unique to row/col/sq

This exhausts by Iteration 4 where I start to apply 'exclusion' rules.

The first of these is to look for sitauations where a row/col has either 2 or 3 occrrences of a Digit, but all in the same Square. Hence we can exclude this digit from all other cells within the Sq, and the row/col.

3) Iteration 4 has excluded a number of options which allows (1) and (2) to find more solutions.

4) Iteration 5 is again successful usig rukes (1), and (2)

5) Iteration 6 - once again rules (1) and (2) are exhausted, and applies the exclusion rules

6) Iterations 7,8,9,10 then complete the Puzzle on rules (1) and (2)

I hope this helps. There are a number of other (and perhaps more complex) exclusion rules that are in the program but have not been needed for this solution.

- - - - - - - - - - - - - - -
Iteration Number 1
- - - - - - - - - - - - - - -
Testing for Unique Placements
25 - Digit 8 only candidate for Cell( 5, 8)
Testing for Unique Placements
Test all Digits for unique to Row/Col/Sq
26 - Cell( 1, 3) = 2
27 - Cell( 5, 7) = 2
28 - Digit 2 Only position in Column( 9) is Cell( 8, 9)
29 - Cell( 1, 8) = 3
30 - Digit 8 Only position in Column( 2) is Cell( 4, 2)
31 - Cell( 8, 3) = 8
- - - - - - - - - - - - - - -
Iteration Number 2
- - - - - - - - - - - - - - -
Testing for Unique Placements
32 - Digit 1 only candidate for Cell( 4, 4)
Testing for Unique Placements
Test all Digits for unique to Row/Col/Sq
33 - Digit 1 Only position in Column( 9) is Cell( 6, 9)
34 - Cell( 9, 1) = 2
All Digit = 2 allocated
35 - Cell( 6, 4) = 8
- - - - - - - - - - - - - - -
Iteration Number 3
- - - - - - - - - - - - - - -
Testing for Unique Placements
Test all Digits for unique to Row/Col/Sq
36 - Cell( 6, 6) = 6
- - - - - - - - - - - - - - -
Iteration Number 4
- - - - - - - - - - - - - - -
Testing for Unique Placements
Test all Digits for unique to Row/Col/Sq
Testing for Pairs/Triplets [Rows]
Row 1 - Digit 4 is a Pair in the same Square ~ Columns = 7, 9
Digit 4 not allowed Cell( 3, 9)
Row 6 - Digit 7 is a Pair in the same Square ~ Columns = 1, 3
Digit 7 not allowed Cell( 4, 1)
Digit 7 not allowed Cell( 5, 3)
Digit 7 not allowed Cell( 5, 2)
Testing for Pairs/Triplets [Columns]
Col 8 - Digit 6 is a Triplet in the same Square ~ Rows = 7, 8, 9
Digit 6 not allowed Cell( 7, 7)
Digit 6 not allowed Cell( 8, 7)
Digit 6 not allowed Cell( 9, 7)
- - - - - - - - - - - - - - -
Iteration Number 5
- - - - - - - - - - - - - - -
Testing for Unique Placements
37 - Digit 9 only candidate for Cell( 5, 2)
38 - Digit 3 only candidate for Cell( 5, 3)
39 - Digit 7 only candidate for Cell( 5, 5)
Testing for Unique Placements
40 - Digit 3 only candidate for Cell( 4, 6)
Testing for Unique Placements
41 - Digit 9 only candidate for Cell( 3, 6)
Testing for Unique Placements
42 - Digit 1 only candidate for Cell( 1, 6)
43 - Digit 7 only candidate for Cell( 8, 6)
Testing for Unique Placements
Test all Digits for unique to Row/Col/Sq
44 - Cell( 2, 2) = 1
45 - Digit 7 Only position in Column( 2) is Cell( 9, 2)
- - - - - - - - - - - - - - -
Iteration Number 6
- - - - - - - - - - - - - - -
Testing for Unique Placements
Test all Digits for unique to Row/Col/Sq
Testing for Pairs/Triplets [Rows]
Row 1 - Digit 9 is a Pair in the same Square ~ Columns = 7, 9
Digit 9 not allowed Cell( 2, 7)
Digit 9 not allowed Cell( 2, 9)
Testing for Pairs/Triplets [Columns]
Col 2 - Digit 5 is a Pair in the same Square ~ Rows = 1, 3
Digit 5 not allowed Cell( 3, 3)
Digit 5 not allowed Cell( 2, 3)
Digit 5 not allowed Cell( 3, 1)
Digit 5 not allowed Cell( 2, 1)
Col 2 - Digit 6 is a Pair in the same Square ~ Rows = 1, 3
Digit 6 not allowed Cell( 3, 1)
Digit 6 not allowed Cell( 2, 1)
- - - - - - - - - - - - - - -
Iteration Number 7
- - - - - - - - - - - - - - -
Testing for Unique Placements
46 - Digit 4 only candidate for Cell( 3, 3)
Testing for Unique Placements
47 - Digit 3 only candidate for Cell( 3, 1)
Testing for Unique Placements
Test all Digits for unique to Row/Col/Sq
48 - Cell( 2, 5) = 3
All Digit = 3 allocated
49 - Cell( 3, 5) = 8
- - - - - - - - - - - - - - -
Iteration Number 8
- - - - - - - - - - - - - - -
Testing for Unique Placements
50 - Digit 5 only candidate for Cell( 3, 9)
Testing for Unique Placements
51 - Digit 8 only candidate for Cell( 2, 9)
52 - Digit 6 only candidate for Cell( 3, 2)
Testing for Unique Placements
53 - Digit 5 only candidate for Cell( 1, 2)
54 - Digit 6 only candidate for Cell( 1, 5)
55 - Digit 5 only candidate for Cell( 2, 4)
56 - Digit 6 only candidate for Cell( 2, 7)
Testing for Unique Placements
Test all Digits for unique to Row/Col/Sq
57 - Cell( 7, 7) = 8
All Digit = 8 allocated
- - - - - - - - - - - - - - -
Iteration Number 9
- - - - - - - - - - - - - - -
Testing for Unique Placements
Test all Digits for unique to Row/Col/Sq
58 - Digit 7 Only position in Column( 7) is Cell( 4, 7)
59 - Cell( 7, 9) = 7
60 - Digit 9 Only position in Column( 9) is Cell( 1, 9)
- - - - - - - - - - - - - - -
Iteration Number 10
- - - - - - - - - - - - - - -
Testing for Unique Placements
61 - Digit 4 only candidate for Cell( 1, 7)
62 - Digit 4 only candidate for Cell( 4, 9)
63 - Digit 5 only candidate for Cell( 6, 8)
Testing for Unique Placements
64 - Digit 5 only candidate for Cell( 4, 1)
65 - Digit 7 only candidate for Cell( 6, 3)
Testing for Unique Placements
66 - Digit 9 only candidate for Cell( 2, 3)
67 - Digit 4 only candidate for Cell( 6, 1)
68 - Digit 5 only candidate for Cell( 9, 3)
69 - Digit 9 only candidate for Cell( 9, 7)
Testing for Unique Placements
70 - Digit 7 only candidate for Cell( 2, 1)
All Digit = 7 allocated
71 - Digit 5 only candidate for Cell( 8, 7)
72 - Digit 6 only candidate for Cell( 9, 4)
Testing for Unique Placements
73 - Digit 9 only candidate for Cell( 7, 4)
74 - Digit 1 only candidate for Cell( 8, 5)
75 - Digit 6 only candidate for Cell( 8, 8)
76 - Digit 4 only candidate for Cell( 9, 5)
77 - Digit 1 only candidate for Cell( 9, 8)
All Digit = 1 allocated
Testing for Unique Placements
78 - Digit 6 only candidate for Cell( 7, 1)
All Digit = 6 allocated
79 - Digit 5 only candidate for Cell( 7, 5)
All Digit = 5 allocated
80 - Digit 4 only candidate for Cell( 7, 8)
All Digit = 4 allocated
81 - Digit 9 only candidate for Cell( 8, 1)
All Digit = 9 allocated
Testing for Unique Placements
====================
Puzzle Solved
====================
Guest
 

Postby milobird » Sat Apr 02, 2005 5:52 pm

IJ wrote:I don't see what you mean Milo. I have 4 undecided cells, with possibilities of (67) (367) (23) and (26) - I can't see any exclusive sets in there.

This is confirmed by showing that the 4 undecided cells can resolve in at least two ways, with the 3 in different spots:

6 7 3 6
&
7 3 2 6


Sorry for the late reply.

The number 3 in column 6 can only appear in the lowest box. This lets you make some real progress.
milobird
 
Posts: 21
Joined: 20 March 2005

Re: Rules to solve Puzzle 94

Postby Thumbs » Sat Apr 02, 2005 9:28 pm

Tony Williams wrote:The first of these is to look for sitauations where a row/col has either 2 or 3 occrrences of a Digit, but all in the same Square. Hence we can exclude this digit from all other cells within the Sq, and the row/col.


I do not understand this. If a row, for example, has the possible digit 5 occurring in cells 1 & 2 (or 1, 2 & 3) and NOT in cells 4, 5, 6, 7, 8, and 9 then I can eliminate the possibilities of the digit 5 appearing in the remaining 6 cells of that block in which those 2 or 3 cells appear.
There is no further elimination required in that row, since that digit does no occur in the rest of that row.

Have I missed something?
Thumbs
 
Posts: 6
Joined: 17 March 2005

Telegraph No 37 diabolical 1/4

Postby Guest » Sat Apr 02, 2005 11:27 pm

I am new to the Suduko solving game but having fun writing a REXX program to solve the puzzles (thanks to the hints on this forum). At the moment I am stuck on Fridays puzzle.
So far my program has solved it to:
Code: Select all
-------------------------
|   6 7 | 8 5   |   3 4 | +29                   +              19     +12                   +
|     4 |       | 7     | +2589   258           +139    69     1369   +       158    125    +
| 3 1   | 2 7 4 | 9     | +              58     +                     +       568    56     +
-------------------------
| 7 9   | 4 3   | 8     | +              125    +              26     +       156    1256   +
|       | 7     |       | +1258   23458  1258   +       269    2689   +1245   1569   123569 +
|     6 | 5 1   |   7   | +28     2348          +              289    +24            239    +
-------------------------
| 6   3 |     7 |   4 8 | +       25            +19     29            +15                   +
|       |   4   | 6   7 | +1258   258    12589  +139           1239   +       159           +
| 4 7   | 6 8 5 | 3 2   | +              19     +                     +              19     +
-------------------------

In the bottom row I have two cells with 1&9 as possibles.
If I guess 9 for bottom right the rest of the cells fall into place trivially but what logic could I apply to avoid the need for trial and error.

Bob
Guest
 

Re: Rules to solve Puzzle 94

Postby Tony Williams » Sun Apr 03, 2005 2:48 am

Thumbs wrote:
Tony Williams wrote:The first of these is to look for sitauations where a row/col has either 2 or 3 occrrences of a Digit, but all in the same Square. Hence we can exclude this digit from all other cells within the Sq, and the row/col.


I do not understand this. If a row, for example, has the possible digit 5 occurring in cells 1 & 2 (or 1, 2 & 3) and NOT in cells 4, 5, 6, 7, 8, and 9 then I can eliminate the possibilities of the digit 5 appearing in the remaining 6 cells of that block in which those 2 or 3 cells appear.
There is no further elimination required in that row, since that digit does no occur in the rest of that row.

Have I missed something?


Yes - I think so, the Rule definitely works, but maybe I did not explain the Rule as well as I could.

If the digit 5 occurs 2 or 3 times in the same row in the same square, ie cells 1,2 (and3), then this square is the only option for digit 5 in this row and hence within the square any other occurences of digit 5 in the OTHER two rows of the SQUARE can be eliminated as options. You don't know which of the 2(3) columns in the row that Digit 5 will use, but by elimiating the others - it allows the other rules to come into play - see the log file.

For Puzzle 94, at the end of Iteration 2 we have the following situation for digit 3 in the Middle row of Squares (rows 4,5,6)

(4) - 3 3 - - - - - -
(5) - - 3 - - 3 - - 3
(6) - 3 3 - - 3 -- 3

In Row 4, the first square is the only option for digit 3, and hence digit 3 must occupy this row, and hence square 1.

The occurrences of digit 3 at (5,3), (6,2), and (6,3) within this Square can be eliminated as candidates.

This rule is used multiple times for Puzzle 94 (see log file) . I must admit that it took me some time to realise this as a RULE but it works. Also Puzzle 94 is complex - took 9 Iterations, and also use rules for x,y pairs of digits.
Tony Williams
 
Posts: 18
Joined: 02 April 2005

Postby Guest » Mon Apr 04, 2005 1:10 pm

This is rule 1 of Milo's three. Those three rules are always sufficient to solve any Times puzzle. In fact, you only need rules 1 & 2, if you are willing to take N to 8 (or rather one less the number of undecided cells for a unit).

What they won't solve is pappocom Very Hard puzzles (the next level up from Fiendish). These require the X-wings method...
Guest
 

Postby tannedblondbloke » Sat Apr 09, 2005 9:11 pm

simes wrote:But I'm interested in this thread too. Just because others haven't posted, doesn't mean they don't want to read it.


Agreed - this is the most interesting thread in the whole forum in my opinion!
tannedblondbloke
 
Posts: 16
Joined: 09 April 2005

Re: Telegraph No 37 diabolical 1/4

Postby simes » Sat Apr 09, 2005 9:26 pm

RFB wrote:Telegraph No 37 diabolical 1/4


Pappocom prides himself that his puzzles have a unique solution and are solvable by logic alone, and he hasn't been shown wrong yet.

But, The Telegraph (and Daily Mail) puzzles aren't set by Pappocom, and according to other threads on this forum, they aren't always solvable by logic alone.

So keep up the T&E.
simes
 
Posts: 324
Joined: 11 March 2005
Location: UK

Postby RFB » Sat Apr 09, 2005 11:07 pm

It wasn't until after I had posted that I realized that
www.sudoku.org.uk listed in the Telegraph is not the same as www.sudoku.org !

The solving hints on the telegraph site explicitly suggest that trial & error and backtracking is needed to solve the harder puzzles.

However the forums are more interesting on this site:)
RFB
 
Posts: 43
Joined: 03 April 2005

Breaking Milo's rules?

Postby Morex » Mon Apr 11, 2005 1:06 am

OK I think I've found a violation of Milo's rules.


2) Scan each row/column/box and if n cells with the same set of n possibles are found, remove those numbers from the possibles list of the other cells in that row/column/box.

3) Scan each row/column/box and if n cells are the only ones to contain a certain grouping of n possibles, remove all other possibles from those cells. (This is a more general case of scanning for a unique possible.)


Consider a box (row, column - doesn't matter) that has four squares unfilled. The remaining possibilities in each square in this example are

1234, 23, 124, 124

Rule 2:

Following rule 2, we see that 124 occurs in three boxes, leaving the (partial ) solution

124, 3, 124, 124

However, there exists the alternate solution

3, 2 , 14, 14

so this breaks Milo's rule 2.

Rule 3:

Following rule 3, we see that 23 occurs in two boxes, leaving the (partial) solution

23, 23, 124, 124

and therefore

23, 23, 14, 14

However, there also exists the following solution:

1, 3, 24, 24

which breaks Milo's rule 3.

So either Milo's rules 2 and 3 are incomplete/wrong, or I've misunderstood them (which is more than likely!)

I'm trying to write a program that will solve a Sudoku analytically (i.e. without making conjectures); I read about identifying groups at http://www.sudokusolver.co.uk/solvemethods.html, but I'm not sure how to go about this programatically. Currently my program is stuck on the following:

Code: Select all
       2568   258     | 256                   | 5678   678            |
              258     | 1256   16             | 3568   368    18      |
       56             | 156                   |        46     14      |
------------------------------------------------------------------------
48            468     |               68      |                       |
248           2468    | 1468   146            |        468            |
                      | 468                   | 468           48      |
------------------------------------------------------------------------
       78             | 1468          168     | 478    1478           |
248    2578   12458   |        14     128     | 478                   |
       28     1248    |               128     | 348    1348           |
------------------------------------------------------------------------



This shows the remaining possibilities for the unfilled squares. The above example is the top-left box. The inverse view (with the certain boxes filled in) is:
Code: Select all
1  | 34|  9
74 |  9|   
3 9| 87|2
-----------
 9 |72 |153   
 3 |  5|9 7
517| 93| 2
-----------
9 3| 5 |  2
   |3  | 96
6  |97 |  5 


If anybody can analytically tell me the next move, I'd be very grateful!

-- Morex.
Morex
 
Posts: 1
Joined: 10 April 2005

Morex's unsolved puzzle

Postby Guest » Wed Apr 13, 2005 11:00 pm

Starting from the puzzle

1 3 4 9
7 4 9
3 9 8 7 2
9 7 2 1 5 3
3 5 9 7
5 1 7 9 3 2
9 3 5 2
3 9 6
6 9 7 5

If you run Milo's rules with n=1 you do only get to

1 2568 258 256 3 4 5678 678 9
7 4 258 1256 16 9 3568 368 18
3 56 9 156 8 7 2 46 14
48 9 68 7 2 68 1 5 3
28 3 268 1468 16 5 9 468 7
5 1 7 468 9 3 468 2 48
9 78 3 68 5 168 478 1478 2
28 2578 1258 3 4 128 78 9 6
6 28 1248 9 7 128 38 138 5

From this stage you can open the rules up for n>1 and get the following steps:

Rule 2: in row 4 possible 86 exists in exactly 2 columns {4,3}=68 {4,6}=68 so eliminate 8 from cell {4,1} old=48 new=4
Rule 2: in box 7 possible 82 exists in exactly 2 cells {8,1}=28 {9,2}=28 so eliminate 8 from cell {7,2} old=78 new=7
Rule 2: in box 7 possible 82 exists in exactly 2 cells {8,1}=28 {9,2}=28 so eliminate 8 from cell {8,2} old=2578 new=257
Rule 2: in box 7 possible 82 exists in exactly 2 cells {8,1}=28 {9,2}=28 so eliminate 2 from cell {8,2} old=257 new=57
Rule 2: in box 7 possible 82 exists in exactly 2 cells {8,1}=28 {9,2}=28 so eliminate 8 from cell {8,3} old=1258 new=125
Rule 2: in box 7 possible 82 exists in exactly 2 cells {8,1}=28 {9,2}=28 so eliminate 2 from cell {8,3} old=125 new=15
Rule 2: in box 7 possible 82 exists in exactly 2 cells {8,1}=28 {9,2}=28 so eliminate 8 from cell {9,3} old=1248 new=124
Rule 2: in box 7 possible 82 exists in exactly 2 cells {8,1}=28 {9,2}=28 so eliminate 2 from cell {9,3} old=124 new=14
Rule 2: in column 2 possible 567 exists in exactly 3 rows {3,2}=56 {7,2}=7 {8,2}=57 so eliminate 5 from cell {1,2} old=2568 new=268
Rule 2: in column 2 possible 567 exists in exactly 3 rows {3,2}=56 {7,2}=7 {8,2}=57 so eliminate 6 from cell {1,2} old=268 new=28
Rule 2: in box 1 possible 285 exists in exactly 3 cells {1,2}=28 {1,3}=258 {2,3}=258 so eliminate 5 from cell {3,2} old=56 new=6
Rule 2: in box 7 possible 287 exists in exactly 3 cells {7,2}=7 {8,1}=28 {9,2}=28 so eliminate 7 from cell {8,2} old=57 new=5
Rule 2: in box 7 possible 571 exists in exactly 3 cells {7,2}=7 {8,2}=5 {8,3}=15 so eliminate 1 from cell {9,3} old=14 new=4
Rule 2: in box 7 possible 574 exists in exactly 3 cells {7,2}=7 {8,2}=5 {9,3}=4 so eliminate 5 from cell {8,3} old=15 new=1
Rule 3: in row 3 possible 15 exists in exactly 2 columns{3,4}=156 {3,9}=14 so reduce cell {3,4} old=156 new=15
Rule 3: in row 3 possible 15 exists in exactly 2 columns{3,4}=156 {3,9}=14 so reduce cell {3,9} old=14 new=1
Rule 3: in row 3 possible 54 exists in exactly 2 columns{3,4}=15 {3,8}=46 so reduce cell {3,4} old=15 new=5
Rule 3: in row 3 possible 54 exists in exactly 2 columns{3,4}=15 {3,8}=46 so reduce cell {3,8} old=46 new=4
Rule 3: in column 9 possible 84 exists in exactly 2 rows {2,9}=18 {6,9}=48 so reduce cell {2,9} old=18 new=8
Rule 3: in row 8 possible 287 exists in exactly 3 columns{8,1}=28 {8,6}=128 {8,7}=78 so reduce cell {8,6} old=128 new=28
Rule 3: in box 2 possible 261 exists in exactly 3 cells {1,4}=256 {2,4}=1256 {2,5}=16 so reduce cell {1,4} old=256 new=26
Rule 3: in box 2 possible 261 exists in exactly 3 cells {1,4}=256 {2,4}=1256 {2,5}=16 so reduce cell {2,4} old=1256 new=126
Rule 3: in row 7 possible 6814 exists in exactly 4 columns{7,4}=68 {7,6}=168 {7,7}=478 {7,8}=1478 so reduce cell {7,7} old=478 new=48
Rule 3: in row 7 possible 6814 exists in exactly 4 columns{7,4}=68 {7,6}=168 {7,7}=478 {7,8}=1478 so reduce cell {7,8} old=1478 new=148
Rule 3: in box 3 possible 5673 exists in exactly 4 cells {1,7}=5678 {1,8}=678 {2,7}=3568 {2,8}=368 so reduce cell {1,7} old=5678 new=567
Rule 3: in box 3 possible 5673 exists in exactly 4 cells {1,7}=5678 {1,8}=678 {2,7}=3568 {2,8}=368 so reduce cell {1,8} old=678 new=67
Rule 3: in box 3 possible 5673 exists in exactly 4 cells {1,7}=5678 {1,8}=678 {2,7}=3568 {2,8}=368 so reduce cell {2,7} old=3568 new=356
Rule 3: in box 3 possible 5673 exists in exactly 4 cells {1,7}=5678 {1,8}=678 {2,7}=3568 {2,8}=368 so reduce cell {2,8} old=368 new=36
Rule 3: in row 2 possible 25163 exists in exactly 5 columns{2,3}=258 {2,4}=126 {2,5}=16 {2,7}=356 {2,8}=36 so reduce cell {2,3} old=258 new=25
Rule 3: in column 8 possible 67381 exists in exactly 5 rows {1,8}=67 {2,8}=36 {5,8}=468 {7,8}=148 {9,8}=138 so reduce cell {5,8} old=468 new=68
Rule 3: in column 8 possible 67381 exists in exactly 5 rows {1,8}=67 {2,8}=36 {5,8}=468 {7,8}=148 {9,8}=138 so reduce cell {7,8} old=148 new=18
Rule 1: in row 5 possible 4 exists only in box 5 so eliminate it from cell {6,4} old=468 new=68
Rule 1: in column 9 possible 4 exists only in box 6 so eliminate it from cell {6,7} old=468 new=68
Rule 1: in column 8 possible 7 exists only in box 3 so eliminate it from cell {1,7} old=567 new=56
Rule 1: in box 3 possible 8 exists only in column 9 so eliminate it from cell {6,9} old=48 new=4
Rule 2: in row 8 possible 28 exists in exactly 2 columns {8,1}=28 {8,6}=28 so eliminate 8 from cell {8,7} old=78 new=7
Rule 2: in column 4 possible 68 exists in exactly 2 rows {6,4}=68 {7,4}=68 so eliminate 6 from cell {1,4} old=26 new=2
Rule 2: in column 4 possible 68 exists in exactly 2 rows {6,4}=68 {7,4}=68 so eliminate 6 from cell {2,4} old=126 new=12
Rule 2: in column 4 possible 68 exists in exactly 2 rows {6,4}=68 {7,4}=68 so eliminate 6 from cell {5,4} old=1468 new=148
Rule 2: in column 4 possible 68 exists in exactly 2 rows {6,4}=68 {7,4}=68 so eliminate 8 from cell {5,4} old=148 new=14
Rule 2: in box 2 possible 12 exists in exactly 2 cells {1,4}=2 {2,4}=12 so eliminate 1 from cell {2,5} old=16 new=6
Rule 2: in box 2 possible 26 exists in exactly 2 cells {1,4}=2 {2,5}=6 so eliminate 2 from cell {2,4} old=12 new=1
Rule 2: in box 5 possible 68 exists in exactly 2 cells {4,6}=68 {6,4}=68 so eliminate 6 from cell {5,5} old=16 new=1
Rule 2: in row 1 possible 285 exists in exactly 3 columns {1,2}=28 {1,3}=258 {1,4}=2 so eliminate 5 from cell {1,7} old=56 new=6
Rule 2: in row 1 possible 286 exists in exactly 3 columns {1,2}=28 {1,4}=2 {1,7}=6 so eliminate 2 from cell {1,3} old=258 new=58
Rule 2: in row 1 possible 286 exists in exactly 3 columns {1,2}=28 {1,4}=2 {1,7}=6 so eliminate 8 from cell {1,3} old=58 new=5
Rule 2: in row 1 possible 286 exists in exactly 3 columns {1,2}=28 {1,4}=2 {1,7}=6 so eliminate 6 from cell {1,8} old=67 new=7
Rule 2: in row 1 possible 256 exists in exactly 3 columns {1,3}=5 {1,4}=2 {1,7}=6 so eliminate 2 from cell {1,2} old=28 new=8
Rule 2: in row 2 possible 536 exists in exactly 3 columns {2,5}=6 {2,7}=356 {2,8}=36 so eliminate 5 from cell {2,3} old=25 new=2
Rule 2: in row 7 possible 681 exists in exactly 3 columns {7,4}=68 {7,6}=168 {7,8}=18 so eliminate 8 from cell {7,7} old=48 new=4
Rule 2: in column 4 possible 168 exists in exactly 3 rows {2,4}=1 {6,4}=68 {7,4}=68 so eliminate 1 from cell {5,4} old=14 new=4
Rule 2: in column 7 possible 368 exists in exactly 3 rows {1,7}=6 {6,7}=68 {9,7}=38 so eliminate 3 from cell {2,7} old=356 new=56
Rule 2: in column 7 possible 368 exists in exactly 3 rows {1,7}=6 {6,7}=68 {9,7}=38 so eliminate 6 from cell {2,7} old=56 new=5
Rule 2: in column 7 possible 568 exists in exactly 3 rows {1,7}=6 {2,7}=5 {6,7}=68 so eliminate 8 from cell {9,7} old=38 new=3
Rule 3: in column 3 possible 68 exists in exactly 2 rows {4,3}=68 {5,3}=268 so reduce cell {5,3} old=268 new=68
Rule 3: in box 9 possible 18 exists in exactly 2 cells {7,8}=18 {9,8}=138 so reduce cell {9,8} old=138 new=18
Rule 1: in column 2 possible 2 exists only in box 7 so eliminate it from cell {8,1} old=28 new=8
Rule 1: in box 7 possible 2 exists only in row 9 so eliminate it from cell {9,6} old=128 new=18
Rule 1: in row 1 possible 6 exists only in box 3 so eliminate it from cell {2,8} old=36 new=3
Rule 1: in column 8 possible 6 exists only in box 6 so eliminate it from cell {6,7} old=68 new=8
Rule 1: in box 6 possible 6 exists only in row 5 so eliminate it from cell {5,3} old=68 new=8
Rule 1: in column 3 possible 8 exists only in box 4 so eliminate it from cell {5,1} old=28 new=2
Rule 1: in column 7 possible 8 exists only in box 6 so eliminate it from cell {5,8} old=68 new=6
Rule 1: in box 1 possible 8 exists only in column 2 so eliminate it from cell {9,2} old=28 new=2
Rule 1: in box 6 possible 8 exists only in row 6 so eliminate it from cell {6,4} old=68 new=6
Rule 1: in box 7 possible 8 exists only in row 8 so eliminate it from cell {8,6} old=28 new=2
Rule 2: in column 3 possible 8 exists in exactly 1 rows {5,3}=8 so eliminate 8 from cell {4,3} old=68 new=6
Rule 2: in column 4 possible 6 exists in exactly 1 rows {6,4}=6 so eliminate 6 from cell {7,4} old=68 new=8
Rule 2: in box 5 possible 6 exists in exactly 1 cells {6,4}=6 so eliminate 6 from cell {4,6} old=68 new=8
Rule 2: in box 8 possible 8 exists in exactly 1 cells {7,4}=8 so eliminate 8 from cell {7,6} old=168 new=16
Rule 2: in box 8 possible 8 exists in exactly 1 cells {7,4}=8 so eliminate 8 from cell {9,6} old=18 new=1
Rule 2: in row 7 possible 18 exists in exactly 2 columns {7,4}=8 {7,8}=18 so eliminate 1 from cell {7,6} old=16 new=6
Rule 2: in row 7 possible 68 exists in exactly 2 columns {7,4}=8 {7,6}=6 so eliminate 8 from cell {7,8} old=18 new=1
Rule 1: in row 7 possible 1 exists only in box 9 so eliminate it from cell {9,8} old=18 new=8

The final result is
1 8 5 2 3 4 6 7 9
7 4 2 1 6 9 5 3 8
3 6 9 5 8 7 2 4 1
4 9 6 7 2 8 1 5 3
2 3 8 4 1 5 9 6 7
5 1 7 6 9 3 8 2 4
9 7 3 8 5 6 4 1 2
8 5 1 3 4 2 7 9 6
6 2 4 9 7 1 3 8 5
[/quote]
Guest
 

Postby Guest » Wed Apr 13, 2005 11:41 pm

Morex,

Yes - the wording is perhaps not the clearest!

Rule 2 covers cells where exactly N possibilities are candidates for N cells. So your example doesn't meet this criteria (the first cell also has a 3, making it 4 possibilities in 3 cells)

Likewise in your example for rule 3 (which does at least include the magic "only"), digits 2 & 3 would need to be possibilities in exactly 2 cells, whereas 2 is in fact possible in all 4 cells.

These rules do, as AMcK's post shows, work very well. In fact, you only need to code either rule 2 or 3 - not both - You can get by just need to go up to N=(Number of undecided cells)-1. I found that rule 2 is much more efficient (and easier to code), so I only use that.

A good example would be (12) (23) (13) (1245) (1345)

Both rules would reduce this to (12) (23) (13) (45) (45). Rule 2 would need N=3 (cells 1, 2 & 3 have only 3 digits between them), and Rule 3 would need N=2 (cells 4 & 5 are the only places digits 4 & 5 can live)

Hope this helps, and good luck!
Guest
 

PreviousNext

Return to Software