Mauriès Robert wrote:But before, could you give an example of a sudoku puzzle requiring the use of Wp-whips (p>1) and the resolution of this puzzle?
denis_berthier wrote:Mauriès Robert wrote:But before, could you give an example of a sudoku puzzle requiring the use of Wp-whips (p>1) and the resolution of this puzzle?
Any puzzle not in T&E(1) requires patterns more complex than braids. Unless some exotic pattern brings it back to T&E(1) - a statistically rare phenomenon, although it is highlighted in many examples - such patterns can only be chains. There are S-braids but even those are not as powerful as B-braids.
B-braids and the "simpler" W-whips" are a theoretical tool, very useful in refining the T&E(n) classification. But they are very complex chains with embedded chains and I don't consider them as a practical means of resolution. I haven't even programmed them in SudoRules.
However, using my BpB vs T&E(Bp) theorem, I can easily check in which BpB a puzzle is - which is IMO the only interesting thing about some puzzles.
denis_berthier wrote:Mauriès Robert wrote:denis_berthier wrote:How to obtain this in SudoRules?
1- First, load braids.
2- Second, init the puzzle: (init-sudoku-string "..42....6.6..7..3.2....61..1....46...5..9..1...71....99....37...8..4..5...37....8")
3- Third, ask for the wanted elimination: (try-to-eliminate-candidates 523); SudoRules gives:
braid[8]: r2n1{c3 c6} - r1n1{c6 c2} - r9n1{c2 c5} - c1n5{r1 r9} - r1n7{c2 c8} - r9n6{c1 c8} - c8n9{r1 r3} - b1n9{r3c3 .} ==> r2c3 ≠ 5
What would have happened if at stage 3 Sudorules had found nothing?
Nothing.
Obviously, if the elimination was not available, SudoRules wouldn't do it. Function "try-to-eliminate-candidates" doesn't do more than its name suggests; in particular, it doesn't try to eliminate any other candidate than those listed as arguments.
Mauriès Robert wrote:When you say that Sudorules seeks to eliminate only the candidates given in arguments, do you mean that it seeks to eliminate among all the candidates in the puzzle that have the same value as the candidates given in arguments or among those who see the candidates given in arguments?
denis_berthier wrote:Mauriès Robert wrote:When you say that Sudorules seeks to eliminate only the candidates given in arguments, do you mean that it seeks to eliminate among all the candidates in the puzzle that have the same value as the candidates given in arguments or among those who see the candidates given in arguments?
Only the candidates given as arguments.
Mauriès Robert wrote:denis_berthier wrote:Mauriès Robert wrote:When you say that Sudorules seeks to eliminate only the candidates given in arguments, do you mean that it seeks to eliminate among all the candidates in the puzzle that have the same value as the candidates given in arguments or among those who see the candidates given in arguments?
Only the candidates given as arguments.
I don't understand your answer. Do you mean to say that in the above example, the candidates given as arguments are those of r2c3, so that sudorules is looking for a braid that eliminates one of these candidates?
denis_berthier wrote:I don't understand your answer. Do you mean to say that in the above example, the candidates given as arguments are those of r2c3, so that sudorules is looking for a braid that eliminates one of these candidates?
denis_berthier wrote:"try-to-eliminate-candidates" is not the normal SudoRules way of working. It's only a goodie I added recently.
The normal way of solving a puzzle in SudoRules is the simplest-first strategy.
Mauriès Robert wrote:All the puzzles solved with whips that I have studied (by hand it is necessarily a small quantity), I have been able to solve them with anti-tracks according to the procedure described above. That is to say that for each whip studied, there is a set E such that the target Z of the whip is also the target Z of the anti-track P'(E) in the sense that Z sees both E and a candidate of P'(E).
denis_berthier wrote:Mauriès Robert wrote:All the puzzles solved with whips that I have studied (by hand it is necessarily a small quantity), I have been able to solve them with anti-tracks according to the procedure described above. That is to say that for each whip studied, there is a set E such that the target Z of the whip is also the target Z of the anti-track P'(E) in the sense that Z sees both E and a candidate of P'(E).
As whips are a particular case of braids and anti-tracks are obviously only a degraded version of braids or an improved version of T&E, I can't see anything unexpected here.
Mauriès Robert wrote:denis_berthier wrote:Mauriès Robert wrote:All the puzzles solved with whips that I have studied (by hand it is necessarily a small quantity), I have been able to solve them with anti-tracks according to the procedure described above. That is to say that for each whip studied, there is a set E such that the target Z of the whip is also the target Z of the anti-track P'(E) in the sense that Z sees both E and a candidate of P'(E).
As whips are a particular case of braids and anti-tracks are obviously only a degraded version of braids or an improved version of T&E, I can't see anything unexpected here.
I disagree with your interpretation of the anti-tracks as I use them. They are not degraded versions of the braids, they just do the same elimination work. Among other differences, a braid highlights a contradiction, but the anti-track does not. Nor are they T&E whose principle is to try a candidate that one eliminates if the sequence leads to contradiction.
Mauriès Robert wrote:...what I do with the anti-tracks, namely:
1) I choose a candidate A from a pair of candidates (only two candidates in a CSP variable) and I construct the anti-track P'(E1) with E1=A. The candidate to be eliminated is necessarily among the candidates Zi who see E1 without being candidate of P'(E1).
2) If P'(E1) is successful, the target is eliminated.
3) If P'(E1) does not succeed, i.e. it does not contain a candidate who sees one of the Zi, then,
3a) I abandon this anti-track to resume it possibly in a later state of resolution and I use another candidate A (back to 1).
3b) I choose a set E2={A,Zi1} composed of A and one Zi1 of the Zi, in order to construct the anti-track P'(E2) which becomes an extension of P'(E1). The target is then one of the Zi that see both E1 and Zi1, and I repeat procedure 2,3,a,b with E2.
With this procedure, I progressively eliminate the Zi that cannot be the target of the anti-track.
Note that in this procedure I do not try to prove the existence of a contradiction in the sequence of construction of the anti-track, a construction which stops with 2) or 3a). But if a contradiction appears before the end of the procedure, all the Zi that see the last Ej used would be eliminated at once.
1) choose a candidate A from a bivalue cell.
2) if T&E(BRT or S, 1, A) finds an error, then eliminate A
3) otherwise:
3a) either give up and goto 1)
3b) or go one level of T&E deeper, possibly iterating (which includes possibly going still deeper in T&E).
Mauriès Robert wrote:All the puzzles solved with whips that I have studied (by hand it is necessarily a small quantity), I have been able to solve them with anti-tracks according to the procedure described above. That is to say that for each whip studied, there is a set E such that the target Z of the whip is also the target Z of the anti-track P'(E) in the sense that Z sees both E and a candidate of P'(E).