I was wondering why is it that any given sudoku puzzle can be completed to a unique solution?
Thanks
nizz wrote:what causes an invalid puzzle?
nizz wrote:one more thing, =p
what is the most number of givens that any invalid puzzle has had?
+-------+-------+-------+
| . . 3 | 5 9 2 | 6 7 8 |
| 2 7 5 | 6 8 1 | 9 3 4 |
| 9 8 6 | 3 7 4 | 2 1 5 |
+-------+-------+-------+
| . . 2 | 7 3 5 | 8 6 9 |
| 5 3 8 | 1 6 9 | 4 2 7 |
| 7 6 9 | 2 4 8 | 1 5 3 |
+-------+-------+-------+
| 3 9 1 | 8 5 6 | 7 4 2 |
| 6 5 4 | 9 2 7 | 3 8 1 |
| 8 2 7 | 4 1 3 | 5 9 6 |
+-------+-------+-------+
vidarino wrote:nizz wrote:what causes an invalid puzzle?
Most commonly, too few clues to ensure a unique solution. (I.e. multiple solutions exist.)
Also possible, but rarely seen in print, are puzzles with erroneous clues that will lead to a contradiction (typically making it impossible to fit a certain number in a row, column or box). I.e. no valid solution exists.
mcarne5252 wrote:I was wondering why is it that any given sudoku puzzle can be completed to a unique solution?
+---+---+---+
|126|347|598|
|458|169|732|
|379|285|461|
+---+---+---+
|213|478|659|
|584|692|317|
|697|513|824|
+---+---+---+
|732|851|946|
|845|926|173|
|961|734|285|
+---+---+---+
+---+---+---+
|12.|...|...|
|...|...|...|
|...|...|...|
+---+---+---+
|21.|...|...|
|...|...|...|
|...|...|...|
+---+---+---+
|...|...|...|
|...|...|...|
|...|...|...|
+---+---+---+
XX XX
1..3...98.5........7.2..46......8..9..46..........3.....2.5.....4.9.6.7.96...42..
..6..7.98..8.6...2.79...4..2..4.8..95..6..3.7....1...............59..1...6.7...8.
..63...9.45..6...237....4...1.4.............7.975..8.47...5.9....59..1.3.....4..5
.26.4.......1.97.........61...4.....58..9..1...7..38.4.32...9..8.........6.73..8.
.2..........1......792854...1......9..4...31.6.7..38.4.........8..92.1.....734...
.2.3...98.....9...3....5..1.1...8..9..4..231...75..8.........468.5.......6.7.....
..63..5.84.....7.2.7..8.4.12..4..6.....692..7......8..73...1.....5......9...34...
.26.........1.97.....2..4.1...4...5.58.69......7.1.....32.....68.....1...6.7..2.5
..6..75...5...9.323...8....2.....6.95....2....9...3..4..........4..2..7..617...85
..63....8.58..9.3....2.5...2.....6.......23.769........3.8...4...5..6...9....4.8.
the question of whether it will be solved uniquely is down to whether each "unavoidable set" in the grid has at least one given clue in it.
.........
11 12 13 14 16 17 18 19 22 23 24 25 26 27 28 29 31 35 38 39
11 12 13 14 16 18 19 22 23 24 25 26 28 29 31 32 35 36 38 39
11 12 13 14 15 17 19 21 22 23 24 25 27 29 31 32 34 37
11 12 13 14 15 16 17 19 21 23 24 25 29 31 32 34 36 37
11 12 14 15 17 19 22 27 31 32 34 35 37 39
11 12 14 15 16 17 19 31 32 34 35 36 37 39
11 12 13 14 15 16 18 19 21 22 23 24 25 26 28 29 32 36
11 12 13 14 15 16 18 19 21 22 23 25 26 28 29 31 32 34 36 39
11 12 13 14 15 16 17 18 19 21 22 23 24 25 26 27 28 29
11 12 13 14 15 16 17 18 19 21 22 23 25 26 27 28 29 31 34 39
11 13 14 15 16 17 18 21 23 24 25 26 27 28 33 35 36 37
11 13 14 15 18 21 22 23 24 25 26 27 28 32 33 35 36 37
11 15 19 21 25 28 31 35 38 39
11 12 14 15 16 18 19 21 22 23 24 25 26 28 29 32 33 35 36 38
11 12 14 15 16 18 19 21 24 26 27 28 32 34 35 37 39
11 12 14 15 16 17 18 19 21 22 23 24 25 26 27 28 29 33 35 38
11 12 13 31 33 42 43 61 63 71 72 73 91 93
11 13 31 33 41 43 61 63 71 73 91 93
11 15 21 24 29 34 37 42 44 53 58 65 68 69 73 78 82 87 93 97
11 15 21 24 42 44 53 56 58 65 68 82 85 87 93 96 97
11 17 22 24 34 36 39 42 48 51 56 58 64 68 83 87 93 99
11 17 22 24 36 39 41 42 48 51 56 64 65 68 73 76 83 85 87 93 99
11 17 22 24 36 39 41 42 48 51 56 64 65 68 73 76 85 87 93 97 99
11 17 22 24 36 39 42 48 51 58 64 65 73 75 76 85 87 93 97 99
11 17 22 24 36 39 42 48 51 56 58 64 65 68 73 76 83 85 87 93 99
11 12 13 38 39 42 47 56 58 61 65 68 73 76 79 85 87 92 97
11 12 13 25 29 34 38 39 42 47 54 56 58 61 65 73 76 79 85 87 92 97
11 13 25 29 34 38 41 42 47 54 56 61 68 73 79 85 86 92 93 97
11 13 24 25 29 34 38 41 42 47 54 58 61 65 68 73 79 92 93 97
11 13 38 39 42 47 56 58 61 65 68 76 79 85 86 87 92 93
11 13 25 29 34 38 39 42 47 54 56 58 61 65 76 79 85 86 87 92 93
11 13 25 29 34 38 39 42 47 54 56 58 61 65 73 76 79 85 87 92 93 97
11 16 24 27 29 32 39 42 45 56 59 63 65 68 71 73 76 85 88 93 94
11 12 19 23 24 35 39 41 46 52 56 58 65 67 74 76 81 87 93 98
11 19 23 24 34 35 39 73 74 81 85 87 93 97
11 12 41 42
11 18 26 29 33 34 39 42 49 56 58 62 65 68 76 77 84 85 87 91 93
11 14 15 24 28 31 39 42 44 53 58 65 69 72 76 78 82 89 93 96
11 15 21 24 28 31 39 42 44 53 58 65 69 72 76 78 82 89 93 96
11 14 22 24 31 36 42 48 51 58 64 66
11 14 17 31 36 39 64 66 83 87 93 99
11 14 17 22 24 28 42 48 51 57 58
11 17 22 24 36 39 42 43 48 51 58 64 65 66 72 75 76 83 87 89 95 99
11 17 22 28 31 39 43 48 51 57 72 75 83 87 89 93 95 99
11 13 24 25 38 39 42 43 47 54 58 61 65 66 72 79 86 87 89 92 93 95
11 13 14 24 25 28 31 38 39 43 47 54 57 58 61 66 72 76 79 86 87 92 95
11 14 24 27 28 31 39 87 88 89
11 14 24 28 31 39 58 59 88 89
11 16 24 27 32 39 42 45 57 59 63 65 71 76 87 89 93 94
11 16 24 27 28 32 39 42 45 57 58 59 63 65 71 76 93 94
11 14 23 24 31 35 43 46 52 57 58 66 67 72 74 81 87 93 95 98
11 14 19 23 24 28 57 58 81 87 89 93 98
11 14 24 28 31 39 57 58 87 89
11 14 24 26 28 31 33 39 42 43 49 55 57 58 62 65 66 72 77 84 89 91 93 95
11 14 18 24 26 28 33 39 43 49 55 57 58 62 66 72 77 84 87 89 91 93 95
11 13 15 21 24 25 42 44 47 53 54 58 61 65 69 76 78 79 82 86 87 93 96
11 13 15 21 24 25 37 38 42 44 47 61 65 69 78 79 92 93
11 13 15 21 24 25 37 39 42 44 47 61 65 69 76 79 86 87 92 93
11 15 21 24 37 38 39 44 47 54 58 65 69
11 13 24 25 37 38 42 47 54 58 61 65 76 78 82 87 92 93 96
11 13 24 25 37 38 39 42 44 53 54 61 65 76 78 79 82 87 93 96
11 13 15 21 24 25 38 39 53 54 58 61 65 69 78 79
11 15 21 24 37 39 42 44 53 58 65 69 76 78 82 87 93 96
11 15 21 24 42 44 49 62 65 69
11 15 18 21 24 26 33 37 42 44 53 55 62 65 77 78 82 84 91 96
11 17 22 24 25 36 39 42 48 51 54 58 61 65 75 76 83 87 93 99
11 13 17 22 24 36 38 39 42 47 48 54 58 61 64 65 75 76 79 83 86 87 92 93 99
11 16 17 22 24 27 42 45 48 51 59 63 65 71 76 83 88 93 94 99
11 17 22 27 32 39 42 48 51 58 59 83 87 88 93 99
11 16 22 24 32 36 42 45 63 64 65 71 75 76 93 94
11 16 17 32 36 39 42 45 48 51 58 63 64 71 75 83 87 93 94 99
11 17 22 23 24 35 36 39 46 48 51 52 64 65 67 81 87 93 98 99
11 17 22 23 24 36 39 46 48 51 52 64 67 74 76 81 87 93 98 99
11 17 19 22 24 35 36 39 42 46 48 51 52 58 64 65 67 98 99
11 17 19 22 24 36 39 42 46 48 51 52 58 64 67 74 76 98 99
11 17 19 23 24 35 39 64 65 74 75 81 83 87 93 99
11 17 19 23 24 35 36 39 74 75 76 81 83 87 93 99
11 19 22 23 24 35 39 42 46 48 51 58 65 67 74 76 81 83 87 93 98
11 19 22 23 24 35 39 42 48 51 58 64 65 74 75 81 83
11 19 22 23 24 35 36 39 42 48 51 58 74 75 76 81 83
11 17 22 24 36 39 42 48 51 58 64 65 75 76 83 87 93 99
11 13 42 47 52 58 61 67 81 87 92 93 98
11 13 24 25 52 54 58 61 65 67 81 87 92 93 98
11 13 24 25 42 46 52 54 61 65 74 76 92 93
11 13 19 23 24 35 39 42 46 47 61 65 67 74 76 92 93
11 13 19 23 25 35 38 42 46 47 52 54 58 74 79 81 86 87 93 98
11 13 19 23 24 25 35 38 46 47 54 58 65 67 74 79 81 86 87 93 98
11 13 19 23 24 25 35 38 42 46 47 61 65 67 74 76 79 81 86 92 93 98
11 19 23 24 25 35 38 39 42 46 52 54 61 65 74 76 79 81 86 92 93 98
11 19 23 24 35 38 39 46 47 54 58 65 67 74 79 81 86 87 93 98
11 19 23 24 35 38 39 42 46 47 61 65 67 74 76 79 81 86 92 93 98
11 13 24 25 38 39 42 47 54 58 61 65 76 79 86 87 92 93
11 13 18 33 39 42 49 55 58 61 62 65 92 93
11 18 24 25 33 38 39 42 47 54 58 61 65 76 79 86 87 91 92 93
11 16 24 27 32 39 42 45 58 59 63 65 71 76 87 88 93 94
11 16 24 27 32 39 42 49 55 58 59 62 63 65 71 76 87 88 93 94
11 18 32 33 39 42 45 49 55 58 63 65 91 93
11 19 23 24 35 39 42 46 52 58 65 67 74 76 81 87 93 98
11 18 33 39 42 49 55 58 62 65 91 93
................
+---+---+---+
|.2.|...|...|
|45.|...|...|
|...|...|..1|
+---+---+---+
|...|...|...|
|...|...|...|
|...|...|...|
+---+---+---+
|...|...|...|
|...|...|...|
|..1|...|...|
+---+---+---+ these clues are 12,21,22,39,93. The clue at position 11 has got to be a 1 and therefore can be Inserted
Therefore a generated clue can be inserted when ALL the unavoidable sets with this clue in it already have in them at least one given clue.
Worse than "very challenging", the hitting set problem is NP-complete.coloin wrote:I believe it is very challenging to write a computor program to incorporate this theory into finding the minimum and maximum hitting sets for a grid
"NP stands for Nondeterministic Polynomial. Which is concise, if not exactly illuminating. If a problem is NP, that means you can easily verify whether someone has found the right answer. For example, if someone tells you that the combination to their suitcase is 4-5-1, then you can just dial up 4-5-1 and see if it opens. The important thing is that it's easy to verify whether you've got the right answer, but it's not necessarily easy, or even feasible, to come up with the right answer in the first place. So, an example of an NP problem is, "find the combination to this suitcase." If you come up with a way to answer that question, it's easy for me to tell whether you're right.
.....So for practical purposes, NP-complete problems are the ones that we know are hard, even though we can't prove that they're hard.
1..3...98
.5.......
.7.2..46.
.....8..9
..46.....
.....3...
..2.5....
.4.9.6.7.
96...42..