View previous topic :: View next topic |
Author |
Message |
| sd9981
| Joined: 08 Aug 2006 | Posts: 6 | : | Location: http://www.sd9981.com | Items |
|
Posted: Tue Nov 21, 2006 12:13 pm Post subject: How to find Empty Rectangles |
|
|
How to find Empty Rectangles with computer? |
|
Back to top |
|
|
| Ruud Site Admin
| Joined: 17 Sep 2005 | Posts: 708 | : | Location: Netherlands | Items |
|
Posted: Tue Nov 21, 2006 12:46 pm Post subject: |
|
|
foreach digit
- foreach row (R1) with only 2 candidates
- - foreach of these 2 candidates (C1) (name the other C2)
- - - foreach other box in the tower containing C1
- - - - if all candidates in this box which are not in the same column as C1 are located on a single row (R2)
- - - - - eliminate candidate from R2 in the same column as C2
do the same swapping columns and rows.
Ruud _________________ Meet me at sudocue.net |
|
Back to top |
|
|
| MCondron
| Joined: 17 Jul 2006 | Posts: 35 | : | Location: Houston, TX | Items |
|
Posted: Sat Jan 06, 2007 7:19 pm Post subject: |
|
|
I do it slightly differently:
Code: |
Repeat this for each digit, k:
- For each row with a conjugate pair in k which has its two cells in different boxes
- For each of the two cells in the pair (call one A and the other B)
- Scan over all cells in the same col as A looking for cells which are
(1) in a different box than A and (2) have k eligible
If one is found satisfying (1) and (2) call it V (a potential victim) and then:
- Find the box where B's col intersects the V's line
- For all cells in that box,
Paint each with flags (one flag if the cell sees V, another for B)
- For all cells in that box
Test that every cell with k eligible must have either the V flag or B flag set
- If all cells in that box meet those criteria, then k can be removed from V's candidate digit list.
And of course, repeat again interchanging rows and cols.
|
It's not really necessary to use two different flags when painting which cells in the box can see V or B. The important thing is that any cell which has k on its candidate digit list must be visible to either V or B. |
|
Back to top |
|
|
|