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.