Example:
- Code: Select all
Puzzle Pattern MinLex pattern
+---+---+---+ +---+---+---+ +---+---+---+
|.12|..3|4..| |.xx|..x|x..| |...|...|..x|
|..4|5..|1..| |..x|x..|x..| |...|..x|.x.|
|3.5|...|...| |x.x|...|...| |..x|.x.|xxx|
+---+---+---+ +---+---+---+ +---+---+---+
|...|6..|.2.| |...|x..|.x.| |...|..x|...|
|...|..5|3.6| |...|..x|x.x| |.x.|..x|x..|
|..7|..1|.4.| |..x|..x|.x.| |x.x|.x.|..x|
+---+---+---+ +---+---+---+ +---+---+---+
|...|...|8..| |...|...|x..| |.xx|.x.|...|
|7..|29.|...| |x..|xx.|...| |x..|.x.|...|
|..3|..8|.12| |..x|..x|.xx| |x..|x..|x.x|
+---+---+---+ +---+---+---+ +---+---+---+
- Code: Select all
Puzzle .12..34....45..1..3.5.........6...2......53.6..7..1.4.......8..7..29......3..8.12
Pattern (Lex) .11..11....11..1..1.1.........1...1......11.1..1..1.1.......1..1..11......1..1.11
Pattern (MinLex) ........1.....1.1...1.1.111.....1....1...11..1.1.1...1.11.1....1...1....1..1..1.1
Now, the question is : what is the smallest (valid) pattern?
Here is a first proposal:
- Code: Select all
+---+---+---+ +---+---+---+
|...|...|...| |...|...|...|
|...|...|..x| |...|...|..1|
|...|..x|...| |...|..2|...|
+---+---+---+ +---+---+---+
|..x|...|...| |..3|...|...|
|..x|..x|..x| |..1|..4|..5|
|..x|..x|.x.| |..6|..7|.4.|
+---+---+---+ +---+---+---+
|.x.|.x.|..x| |.4.|.1.|..3|
|.x.|.x.|.x.| |.8.|.3.|.9.|
|.x.|.x.|.xx| |.5.|.2.|.78|
+---+---+---+ +---+---+---+
.................1.....1.....1........1..1..1..1..1.1..1..1...1.1..1..1..1..1..11
Filtering: assuming we know the smallest pattern Pmin, we have a kind of filter for the patterns:
if a pattern P is such that MinLex(P) <Pmin, then we can conclude that the pattern P is not valid.
The filter is not really efficient but it exists.
For a random set of (1,000,000) 17 clue patterns 25% didn't pass the test (i.e. were invalid), assuming my Pmin is the right one...
JPF