Exotic patterns a resume

Advanced methods and approaches for solving Sudoku puzzles

Re: Exotic patterns a resume

Postby champagne » Tue Jun 18, 2013 9:05 am

I adjusted my code to restart the "X" pattern with crossings.

Most of the puzzles with "double set double link" candidates are back with 2 exceptions :

- puzzles passing the limit of 30 known with easy moves
- about 6 puzzles where I suspect that the difference comes from the moves included in the preliminary cleaning.

The limit of 50 given seems not good for high ratings. We loose some interesting solutions.
The second case has also to be considered. Some of you already pointed in the past that solving first an exocet (or a double exocet) can show a hidden rank0 logic.
champagne
2017 Supporter
 
Posts: 7466
Joined: 02 August 2007
Location: France Brittany

Re: Exotic patterns a resume

Postby David P Bird » Tue Jun 18, 2013 9:33 am

Hi Champagne,

As we know with Xsudo there are many ways truth and link sets can be selected to make the same eliminations. I therefore suspect that one of your coding problems is therefore to avoid checking for the same scenario from multiple viewpoints.

You wrote:I am so far extracting puzzles with one of the following patterns, all in a multi floor view :
- rows as main base for sets, columns as main base for links and reverse
- "X" (2 rows, 2 columns, 4 boxes) set base with no floor digit at the crossing.

So the viewpoints you start with are the same as mine (not so surprising). What you might be missing is what you do when you find a rank 1 pattern which could be converted into a rank 0 by using the tactics that Blue and I have covered.

I'll go over again what I'm doing once a set of truth and link sets has been selected:
Say you have identified a rank 1 pattern with 20 Potential Eliminations. 19 of the PEs will be valid and one will be invalid.
Now check if the Potential Eliminations would leave a house without any instances of a digit.
If you find say that box 3 would be left without a (9) you have isolated a subset of PEs that contains the invalid one.
You can now either make all the other PEs or use one of those tactics to covert the pattern to rank 0 (this will do much the same thing but will make the notation tidier).

I think that exploring this area in your code first would be the way to go before making any more dramatic changes, but wait for Blue's opinion first!

David
David P Bird
2010 Supporter
 
Posts: 1043
Joined: 16 September 2008
Location: Middle England

Re: Exotic patterns a resume

Postby champagne » Tue Jun 18, 2013 10:23 am

David P Bird wrote:
I'll go over again what I'm doing once a set of truth and link sets has been selected:
Say you have identified a rank 1 pattern with 20 Potential Eliminations. 19 of the PEs will be valid and one will be invalid.
Now check if the Potential Eliminations would leave a house without any instances of a digit.
If you find say that box 3 would be left without a (9) you have isolated a subset of PEs that contains the invalid one.
You can now either make all the other PEs or use one of those tactics to covert the pattern to rank 0 (this will do much the same thing but will make the notation tidier).

I think that exploring this area in your code first would be the way to go before making any more dramatic changes, but wait for Blue's opinion first!

David


Hi again David,

I followed with interest the discussion some time ago on the rank1 logic and my code detects and stores them (may be after revision of the last version, but the main part is the code used to find the rank 0 logic).

I have in mind disappointing uses of that logic (If I except leren's full expansion of each of the "potential eliminations") and I clearly missed your exchanges with blue. Could you give me the corresponding link
champagne
2017 Supporter
 
Posts: 7466
Joined: 02 August 2007
Location: France Brittany

Re: Exotic patterns a resume

Postby ronk » Tue Jun 18, 2013 11:30 am

champagne wrote:I just try to qualify puzzles towards some solving techniques. When I have found one rank0 logic, the job is done.

Then use an all-row or all-column base where there is no overlap, as you already do for many puzzles. For some of these "tougher" cases, just add a cell to the base, or two cells, or three cells with box covers.
ronk
2012 Supporter
 
Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

Re: Exotic patterns a resume

Postby champagne » Tue Jun 18, 2013 1:20 pm

ronk wrote:
champagne wrote:I just try to qualify puzzles towards some solving techniques. When I have found one rank0 logic, the job is done.

Then use an all-row or all-column base where there is no overlap, as you already do for many puzzles. For some of these "tougher" cases, just add a cell to the base, or two cells, or three cells with box covers.


This is, with the "X" mode in addition, the basic process.
I have no overlapping in rows/columns mode and it is somehow by "bug" that I had some overlapping in "X" mode in the old code (now again in the fresh one after having proven that it is valid).
Adding cells or using box links is usually just a matter of optimisation of the count. In such cases, I find the corresponding rank 0 logic.

For other examples that I have seen here, defining the precise rules to apply in the search is not so easy.
champagne
2017 Supporter
 
Posts: 7466
Joined: 02 August 2007
Location: France Brittany

Re: Exotic patterns a resume

Postby ronk » Tue Jun 18, 2013 1:48 pm

champagne wrote:
ronk wrote:Then use an all-row or all-column base where there is no overlap, as you already do for many puzzles. For some of these "tougher" cases, just add a cell to the base, or two cells, or three cells with box covers.
This is, with the "X" mode in addition, the basic process.
I have no overlapping in rows/columns mode and it is somehow by "bug" that I had some overlapping in "X" mode in the old code (now again in the fresh one after having proven that it is valid).
Adding cells or using box links is usually just a matter of optimisation of the count. In such cases, I find the corresponding rank 0 logic.

For other examples that I have seen here, defining the precise rules to apply in the search is not so easy.

"After having proven that it is valid"? So you actually have no issue with the so-called "X" mode. And you apparently find an all-row, an all-column, and a 2-row/2-col multi-digit fish, all for the same pencilmarks of an almost-sk-loop and with the same (or essentially the same) exclusions. Why is this not sufficient in your solver?
ronk
2012 Supporter
 
Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

Re: Exotic patterns a resume

Postby blue » Tue Jun 18, 2013 3:31 pm

ronk wrote:And you apparently find an all-row, an all-column, and a 2-row/2-col multi-digit fish, all for the same pencilmarks of an almost-sk-loop and with the same (or essentially the same) exclusions.

The all-row and all-column fish that are guaranteed to be present, almost always need a box link (or a box truth), and champagne's code isn't set up to find cases like that, I think.
blue
 
Posts: 1052
Joined: 11 March 2013

Re: Exotic patterns a resume

Postby champagne » Tue Jun 18, 2013 3:56 pm

blue wrote:
ronk wrote:And you apparently find an all-row, an all-column, and a 2-row/2-col multi-digit fish, all for the same pencilmarks of an almost-sk-loop and with the same (or essentially the same) exclusions.

The all-row and all-column fish that are guaranteed to be present, almost always need a box link (or a box truth), and champagne's code isn't set up to find cases like that, I think.



what is for sure is that I have currently

- no process adding box truths to a row or column based start
- no process working on a cells basis
- no process except the "X" mixing rows and columns as sets.

Normally, the optimisation process consider box covers when the basis (rows or columns) fill a band or a stack, but I am missing tests to guaranty that it works properly.
This is the only situation where the process try a box cover with a rows or columns start
champagne
2017 Supporter
 
Posts: 7466
Joined: 02 August 2007
Location: France Brittany

Re: Exotic patterns a resume

Postby blue » Tue Jun 18, 2013 4:40 pm

Hi champagne,

David P Bird wrote:I think that exploring this area in your code first would be the way to go before making any more dramatic changes, but wait for Blue's opinion first!

champagne wrote:I have in mind disappointing uses of that logic (If I except leren's full expansion of each of the "potential eliminations") and I clearly missed your exchanges with blue. Could you give me the corresponding link

I can show you what I do. I think it's what David was referring to.
This is only the tip of the iceberg, for rank 0 patterns, of course.

The basic kind of pattern that David finds, can be put into a base/cover form in one of 8 different ways.

Below, D1 and D2 are complementary digit sets.
There is a set of "selected columns", and a set of "selected rows".

Code: Select all
Naked Set -- cell truths covered by row/col links

   selected cols     unselected cols          selected cols.     unselected cols 
 +-----------------+-----------------+      +-----------------+-----------------+
s|   cell truths   |                 |     s|                 |                 |
e| D1 row  links   | D1 row  links   |     e|                 |                 |
l| D2 col. links   |                 |     l|                 | D1 col  links   |
 |                 | D1 eliminations |      |                 | D1 eliminations |
 +-----------------+-----------------+      +-----------------+-----------------+
u|                 |                 |     u|                 |   cell truths   |
n|                 |                 |     n|                 | D1 col. links   |
s| D2 col. links   |                 |     s| D2 row. links   | D2 row  links   |
 | D2 eliminations |                 |      | D2 eliminations |                 |
 +-----------------+-----------------+      +-----------------+-----------------+

Row Fish -- row truths covered by column links and cell links

   selected cols     unselected cols          selected cols     unselected cols 
 +-------------=---+-----------------+      +-------------=---+-----------------+
s|                 |   cell links    |     s|                 |                 |
e| D2 row  truths  | D2 row  truths  |     e|                 |                 |
l| D2 col. links   |                 |     l|                 | D1 col. links   |
 |                 | D1 eliminations |      |                 | D1 eliminations |
 +-----------------+-----------------+      +-----------------+-----------------+
u|                 |                 |     u|   cell links    |                 |
n|                 |                 |     n| D1 row truths   | D1 row  truths  |
s| D2 col. links   |                 |     s|                 | D1 col. links   |
 | D2 eliminations |                 |      | D2 eliminations |                 |
 +-----------------+-----------------+      +-----------------+-----------------+

Column Fish -- column truths covered by row links and cell links

   selected cols     unselected cols          selected cols     unselected cols 
 +-------------=---+-----------------+      +-------------=---+-----------------+
s|                 |                 |     s|                 |   cell links    |
e| D1 row  links   | D1 row  links   |     e|                 |                 |
l| D1 col. truths  |                 |     l|                 | D2 col. truths  |
 |                 | D1 eliminations |      |                 | D1 eliminations |
 +-----------------+-----------------+      +-----------------+-----------------+
u|   cell links    |                 |     u|                 |                 |
n|                 |                 |     n| D2 row links    | D2 row  links   |
s| D1 col. truths  |                 |     s|                 | D2 col. truths  |
 | D2 eliminations |                 |      | D2 eliminations |                 |
 +-----------------+-----------------+      +-----------------+-----------------+

Hidden Set -- row/col truths covered by cell links

   selected cols     unselected cols          selected cols     unselected cols 
 +-------------=---+-----------------+      +-------------=---+-----------------+
s|   cell links    |   cell links    |     s|                 |   cell links    |
e| D2 row  truths  | D2 row  truths  |     e|                 |                 |
l| D1 col. truths  |                 |     l|                 | D2 col. truths  |
 |                 | D1 eliminations |      |                 | D1 eliminations |
 +-----------------+-----------------+      +-----------------+-----------------+
u|   cell links    |                 |     u|   cell links    |   cell links    |
n|                 |                 |     n| D1 row truths   | D1 row  truths  |
s| D1 col. truths  |                 |     s|                 | D2 col. truths  |
 | D2 eliminations |                 |      | D2 eliminations |                 |
 +-----------------+-----------------+      +-----------------+-----------------+

The Hidden Set form is usually too big for XSudo to handle -- "DLXA limit".

The 8 forms can be converted to each other, using "Obi-Wahn transformations". For example, to get from the 1st Naked Set version to the 1st Row Fish version, in the "selected rows" section, you add row truths for every digit, covered by cell links for every cell, and then let the row links and cell truths that were originally there, cancel with the corresponding (added) row truths and cell links. There are other things that you can do with them too, but these are the basic forms.

What I have for search code, is too slow to check a long list of puzzles. I loop through (almost) all 512x512x512 combinations of D1, "selected rows" and "selected columns" choices, and see what happens. I have an "#ifdef" option to restrict the search to 4 or 5 digits and 4 or 5 selected rows/columns.

If you have a "D1, selected rows, and selected columns" choice, you can focus on the Naked Set form, and count the number of cell truths, and row/column links that are required. Generally you need a lot more links than there are cell truths. If the counts match, you're done, of course. If they don't match, then it wouldn't matter which of the 8 forms you used, the difference in counts would be the same.

If the difference is small, sometimes you can find additional "truths" to add, that 1) don't overlap the "cell truths" block, and 2) are covered by the row/column links that are already there. I think this is what David was referring to.

The added truths can be any of these:
  • cell truths in the upper right block, for cells that only have candidates from D1
  • cell truths in the lower left block, for cells that only have candidates from D2
  • for digits in D1, box or column truths, that have all of thier candidates in the upper right block
    (It's column truths for the Naked set form on the left, and row truths for the one on the right).
  • for digits in D2, box or row truths, that have all of thier candidates in the lower left block
    (It's row truths for the Naked set form on the left, and column truths for the one on the right).
If you add a mix of truths like that, you need to make sure that they don't overlap (don't share any candidates).

When box truths are added in that process, sometimes you can use an Obi-Wahn transformations to get them converted to box links, and reduce the truth count -- e.g. converting one box truth and two row links, into one box link.

If you can do that, and get the truth and link counts to match for the Naked Set form, then you can still do an Obi-Wahn transformation to convert the result into a row or column fish. If one of the added truths was a cell truth, then depending on where it is, and which form, row or column, the cell truth will vanish ... cancelling with a cell link.

The Obi-Wahn conversion, doesn't always produce the best result. Sometimes the result will be an interesting rank 0 pattern, with truths and links for a naked/hidden set added. There's a similar situation for the "Naked Set" form, where sometimes it's an interesting pattern with a small naked set added.
Added: more along that same line ... sometimes adding cell truths to make the counts match, picks up a small naked set with some cells in the "naked set" block, and the rest in the "added truths" block. You'ld rather have deleted cells in the "naked set" block, in that case. It isn't always a very clean process. It's best to look at the results before posting anything. Code to find and remove embedded logic for (single row/col) naked/hidden sets, would work too.

Regards,
Blue.
Last edited by blue on Fri Jun 21, 2013 2:20 am, edited 4 times in total.
blue
 
Posts: 1052
Joined: 11 March 2013

Re: Exotic patterns a resume

Postby David P Bird » Tue Jun 18, 2013 11:23 pm

Champagne, I've tried to mimic Xsudo using highlighting colours on a text document but I got into a mess with it.

The MSLS approach uses similar concepts to Xsudo but in a different way, so what I say here may or may not apply to you.

When you find a X pattern with one of the row/column intersections occupied by a floor digit give that approach up because that occupied cell is a killer. Go back instead to using rows and columns one for truths and the other for links. You should find that like me you can only get close to a rank 0 pattern.

Now to fine-tune that collection of sets you will need to be able to add box and/or cell sets into the process too. This is when the tactics that Blue has listed for you can be used. But I can't give any more specific help in that area.

Blue, The choice of 4 digits is usually obvious – they will occur as givens in pairs in 4 boxes as for the SK loop pattern. I guess Champagne has similar rules for the more regular multi-fish patterns.
The choice of rows and columns can also be restricted by eliminating any line where none of the digits is placed.
Together these options would streamline the initial search procedure considerably.

David
David P Bird
2010 Supporter
 
Posts: 1043
Joined: 16 September 2008
Location: Middle England

Re: Exotic patterns a resume

Postby ronk » Tue Jun 18, 2013 11:59 pm

blue wrote:
ronk wrote:And you apparently find an all-row, an all-column, and a 2-row/2-col multi-digit fish, all for the same pencilmarks of an almost-sk-loop and with the same (or essentially the same) exclusions.

The all-row and all-column fish that are guaranteed to be present, almost always need a box link (or a box truth), and champagne's code isn't set up to find cases like that, I think.

Thought that's what champagne meant when ...
champagne wrote:Adding cells or using box links is usually just a matter of optimisation of the count. In such cases, I find the corresponding rank 0 logic.

... but this sentence was apparently in a different context.
ronk
2012 Supporter
 
Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

Re: Exotic patterns a resume

Postby blue » Wed Jun 19, 2013 3:06 am

ronk wrote:Thought that's what champagne meant when ...
champagne wrote:Adding cells or using box links is usually just a matter of optimisation of the count. In such cases, I find the corresponding rank 0 logic.

... but this sentence was apparently in a different context.

Must have been for the 2-row/2-col/+ cases.
blue
 
Posts: 1052
Joined: 11 March 2013

Re: Exotic patterns a resume

Postby blue » Wed Jun 19, 2013 3:20 am

Hi David,

David P Bird wrote:Blue, The choice of 4 digits is usually obvious – they will occur as givens in pairs in 4 boxes as for the SK loop pattern. I guess Champagne has similar rules for the more regular multi-fish patterns.
The choice of rows and columns can also be restricted by eliminating any line where none of the digits is placed.
Together these options would streamline the initial search procedure considerably.

Yes, but I was looking for anything and everything -- not just patterns related to SK-loops.
I didn't want to overlook the 3-digit SK-loop variant, either.
I haven't checked but there might be a lot of those in champagne's "grey zone" list.

Regards,
Blue.
blue
 
Posts: 1052
Joined: 11 March 2013

Re: Exotic patterns a resume

Postby champagne » Wed Jun 19, 2013 6:36 am

blue wrote:
ronk wrote:Thought that's what champagne meant when ...
champagne wrote:Adding cells or using box links is usually just a matter of optimisation of the count. In such cases, I find the corresponding rank 0 logic.

... but this sentence was apparently in a different context.

Must have been for the 2-row/2-col/+ cases.


This I can clarify

whatever is the basis (rows columns "X" ) , I consider the moment where I try a cover using a row or a column (crossing unit).

There are several ways to achieve the cover within the crossing unit. The basic one is to use the sets necessary to cover all candidates in the crossing lines.
If you have any other way to cover the sets, it must be used. The basic solution would not give a rank 0 SLG

One example: we assume the basic count is 4 sets (say a 4 floors and all digits there in the crossings)
If the number of crossing is less than 4, a lower count to find a rank0 logic is to use the cells in the crossings as cover;

Second example: we have in the crossing unit some cells with no extra digit (not crossing cells) they can be added. Usually, they contains the digits used in the basic solution, but we could consider as well adding digits (and then sets in the crossing unit)
If the new count
added cells + added sets (usually no added set)
is positive, that solution must be used

third example not valid with a "X" start
lets assume we have a band/stack filled in our sets. You then must consider an exchange between the crossing units cover and a mix of box cover and cell cover.
If so you can reduce the count, this is what you must do to have a chance to find a SLG

The third situation is the only one where my code finds a box cover with a rows or columns start.
With a "X" start, I use a box cover in the four boxes. The last case could still be seen in the last band/stack (s)

If my code works properly, that's the kind of rank0 logic I can find to day, combining to optimum these cases.

But this remains only part of the possible rank0 logic
champagne
2017 Supporter
 
Posts: 7466
Joined: 02 August 2007
Location: France Brittany

Re: Exotic patterns a resume

Postby champagne » Wed Jun 19, 2013 6:57 am

Hi David,

AS assumed blue, I am not at all locked in a 4 digits nor in the "X" case here. When I am looking for the rank 0 logic, I search the entire 3-5 digits field and (from memory) 3 to 5 rows or columns. But this is a parameter I can easily change.

David P Bird wrote:When you find a X pattern with one of the row/column intersections occupied by a floor digit give that approach up because that occupied cell is a killer.
David


We have just studied examples showing the contrary. I reintroduced that case now clearly validated (not to hard to revise the code) mainly because the corresponding rank0 logic(s) where not in the field searched by my program. I don't know if the overall frequency is good, but the number of added puzzles extracted through that criteria is relatively small.


David P Bird wrote:Now to fine-tune that collection of sets you will need to be able to add box and/or cell sets into the process too. This is when the tactics that Blue has listed for you can be used. But I can't give any more specific help in that area.
David


I described in a separate post what I am already doing. I am sure that there is room for a better optimisation.

What is missing (out of marginal improvements in existing starts) is new starts as

- group of cells start
- mix row col start out of the "X" case
- boxes starts (at least one example given by ronk but with other possibilities to define the rank 0 logic)
....

extracting other puzzles
champagne
2017 Supporter
 
Posts: 7466
Joined: 02 August 2007
Location: France Brittany

PreviousNext

Return to Advanced solving techniques