[math-fun] Sudoku levels
I've since extended my program to what I call "level 2" -- propagating forcing constraints a bit further: If a digit in a _row_ can only appear in 2 or 3 positions within the same 3x3 block, then that digit is eliminated from the rest of the block. If the digit can appear in multiple blocks, then we can't eliminate it. Ditto for columns. For blocks, the rule is more complicated. If a digit can only appear within a single row or column within a block, then it can be eliminated from the rest of the row or column, respectively. These new rules, together with the previous set of forcing rules, appears sufficient to solve the LATimes Sudoku's called "Moderate", while the previous set of rules were sufficient for those called "Gentle". However, my "level 2" is not sufficient for LATimes "Diabolical", nor for the Sudoku's in "Sudoku Genius". It would appear that the LATimes _does_ have a precise definition of what it means to be "Gentle" (~ level 1), "Moderate" (~ level 2), and "Diabolical". Since "level 2" appears to be exhausting the notion of what can be done with only local rules & "force fields" (the information propagating on rows, columns & blocks), I would suggest that level 2 captures the notion of "non-backtracking". --- BTW, I mentioned that my bit representation produced "surprises" in that some squares "accidentally" produced singleton sets. However, because these singletons were "accidental", they didn't get a chance to propagate their "first-class" status and suppress the same digit in rows, columns and blocks. While this problem is automatically fixed by level 2, this constraint really belongs to level 1, and so my level 1 program has to have an extra check just for this constraint. "The representation giveth, and the representation taketh away."
I'm not clear from your description of level 1 whether you look at every set of k cells -- if a set of k cells out of 9 includes at most k different digits, then those k digits can't appear anywhere else in the set of 9. (I was very pleased when I realized that this rule with k = 1 and k = 8 covered the two usual simplest rules, "if a cell can contain only one digit..." and "if a digit can appear in only one cell...") --Joshua Zucker
What about this rule: If the set of candidate digits for some set of k positions in a row/column/block has cardinality k, then those digits can be eliminated from the rest of that row/column/block. Is that implied by your level 1 or level 2? --ms Henry Baker wrote:
I've since extended my program to what I call "level 2" -- propagating forcing constraints a bit further:
If a digit in a _row_ can only appear in 2 or 3 positions within the same 3x3 block, then that digit is eliminated from the rest of the block. If the digit can appear in multiple blocks, then we can't eliminate it.
Ditto for columns.
For blocks, the rule is more complicated. If a digit can only appear within a single row or column within a block, then it can be eliminated from the rest of the row or column, respectively.
These new rules, together with the previous set of forcing rules, appears sufficient to solve the LATimes Sudoku's called "Moderate", while the previous set of rules were sufficient for those called "Gentle".
However, my "level 2" is not sufficient for LATimes "Diabolical", nor for the Sudoku's in "Sudoku Genius".
It would appear that the LATimes _does_ have a precise definition of what it means to be "Gentle" (~ level 1), "Moderate" (~ level 2), and "Diabolical".
Since "level 2" appears to be exhausting the notion of what can be done with only local rules & "force fields" (the information propagating on rows, columns & blocks), I would suggest that level 2 captures the notion of "non-backtracking".
---
BTW, I mentioned that my bit representation produced "surprises" in that some squares "accidentally" produced singleton sets. However, because these singletons were "accidental", they didn't get a chance to propagate their "first-class" status and suppress the same digit in rows, columns and blocks. While this problem is automatically fixed by level 2, this constraint really belongs to level 1, and so my level 1 program has to have an extra check just for this constraint. "The representation giveth, and the representation taketh away."
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
Right, that's the rule I was trying to state, and pointing out that when k = 1 and k = 8 it amounts to the "if there's only one possibility for a cell" and "if there's only one cell where the digit can go" rules ... --Joshua On 6/30/06, Mike Speciner <speciner@ll.mit.edu> wrote:
What about this rule:
If the set of candidate digits for some set of k positions in a row/column/block has cardinality k, then those digits can be eliminated from the rest of that row/column/block.
Is that implied by your level 1 or level 2?
--ms
Henry Baker wrote:
I've since extended my program to what I call "level 2" -- propagating forcing constraints a bit further:
If a digit in a _row_ can only appear in 2 or 3 positions within the same 3x3 block, then that digit is eliminated from the rest of the block. If the digit can appear in multiple blocks, then we can't eliminate it.
Ditto for columns.
For blocks, the rule is more complicated. If a digit can only appear within a single row or column within a block, then it can be eliminated from the rest of the row or column, respectively.
These new rules, together with the previous set of forcing rules, appears sufficient to solve the LATimes Sudoku's called "Moderate", while the previous set of rules were sufficient for those called "Gentle".
However, my "level 2" is not sufficient for LATimes "Diabolical", nor for the Sudoku's in "Sudoku Genius".
It would appear that the LATimes _does_ have a precise definition of what it means to be "Gentle" (~ level 1), "Moderate" (~ level 2), and "Diabolical".
Since "level 2" appears to be exhausting the notion of what can be done with only local rules & "force fields" (the information propagating on rows, columns & blocks), I would suggest that level 2 captures the notion of "non-backtracking".
---
BTW, I mentioned that my bit representation produced "surprises" in that some squares "accidentally" produced singleton sets. However, because these singletons were "accidental", they didn't get a chance to propagate their "first-class" status and suppress the same digit in rows, columns and blocks. While this problem is automatically fixed by level 2, this constraint really belongs to level 1, and so my level 1 program has to have an extra check just for this constraint. "The representation giveth, and the representation taketh away."
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
I implemented the k=1 & k=8 rules, and this is "level 1". Interestingly, these 2 rules are somewhat dual to one another -- perhaps someone else has better insight on this? The k=1 rule says that there's only one possibility for a cell (singleton set), so _broadcast_ this information to the rest of the row, column and block. The information flows out from the cell -- i.e., the cell itself doesn't change, but it potentially changes the rest of the row, column and block. The k=8 rule extracts information from the row, column and block to constrain what goes into the cell. All of the information goes _into_ the cell -- i.e., the only thing that changes is the cell itself. So level one is a series of waves of information alternating out & in. When there's no new information to be processed, the puzzle is either solved, or isn't crackable via level 1. "Level 1" seems to be a very natural level. Unfortunately, it isn't particularly powerful -- it can only handle the LATimes "Gentle" sudokus. "Level 2" would seem to be similar to level 1, except also handling k=2 and k=7. I haven't fully implemented this version of "Level 2", as of yet. At 10:02 AM 6/30/2006, Joshua Zucker wrote:
Right, that's the rule I was trying to state, and pointing out that when k = 1 and k = 8 it amounts to the "if there's only one possibility for a cell" and "if there's only one cell where the digit can go" rules ...
--Joshua
On 6/30/06, Mike Speciner <speciner@ll.mit.edu> wrote:
What about this rule:
If the set of candidate digits for some set of k positions in a row/column/block has cardinality k, then those digits can be eliminated from the rest of that row/column/block.
Is that implied by your level 1 or level 2?
--ms
Henry Baker wrote:
I've since extended my program to what I call "level 2" -- propagating forcing constraints a bit further:
If a digit in a _row_ can only appear in 2 or 3 positions within the same 3x3 block, then that digit is eliminated from the rest of the block. If the digit can appear in multiple blocks, then we can't eliminate it.
Ditto for columns.
For blocks, the rule is more complicated. If a digit can only appear within a single row or column within a block, then it can be eliminated from the rest of the row or column, respectively.
These new rules, together with the previous set of forcing rules, appears sufficient to solve the LATimes Sudoku's called "Moderate", while the previous set of rules were sufficient for those called "Gentle".
However, my "level 2" is not sufficient for LATimes "Diabolical", nor for the Sudoku's in "Sudoku Genius".
It would appear that the LATimes _does_ have a precise definition of what it means to be "Gentle" (~ level 1), "Moderate" (~ level 2), and "Diabolical".
Since "level 2" appears to be exhausting the notion of what can be done with only local rules & "force fields" (the information propagating on rows, columns & blocks), I would suggest that level 2 captures the notion of "non-backtracking".
---
BTW, I mentioned that my bit representation produced "surprises" in that some squares "accidentally" produced singleton sets. However, because these singletons were "accidental", they didn't get a chance to propagate their "first-class" status and suppress the same digit in rows, columns and blocks. While this problem is automatically fixed by level 2, this constraint really belongs to level 1, and so my level 1 program has to have an extra check just for this constraint. "The representation giveth, and the representation taketh away."
participants (3)
-
Henry Baker -
Joshua Zucker -
Mike Speciner