from pattern to puzzle

Everything about Sudoku that doesn't fit in one of the other sections

from pattern to puzzle

Postby P.O. » Sat Oct 07, 2023 10:41 am

a pattern is a subset of the 81 cells of a sudoku grid like this one:
Code: Select all
(1 6 8 13 18 23 25 30 32 37 42 44 49 52 57 60 62 65 72 73 74)
0  .  .  .  .  0  .  0  .
.  .  .  0  .  .  .  .  0
.  .  .  .  0  .  0  .  .
.  .  0  .  0  .  .  .  .
0  .  .  .  .  0  .  0  .
.  .  .  0  .  .  0  .  .
.  .  0  .  .  0  .  0  .
.  0  .  .  .  .  .  .  0
0  0  .  .  .  .  .  .  .

it is the pattern of a puzzle by eleven #e145 which is in 6-template.
to become a puzzle this pattern must be colored and to do this a color distribution must be chosen.
for each size of pattern there is a finite number of distribution of colors available, these are the partitions of the integers of the puzzle size filtered by the constraints to get a single-solution puzzle: 8 or 9 colors, at most 9 cells of the same color.
this pattern has 21 cells, the number of partitions of 21 is 792, here are those that can be used as color distribution:
Hidden Text: Show
Code: Select all
21 cells
77_8: ((3 3 3 3 3 2 2 2) (3 3 3 3 3 3 2 1) (4 3 3 3 2 2 2 2) (4 3 3 3 3 2 2 1)
       (4 3 3 3 3 3 1 1) (4 4 3 2 2 2 2 2) (4 4 3 3 2 2 2 1) (4 4 3 3 3 2 1 1)
       (4 4 4 2 2 2 2 1) (4 4 4 3 2 2 1 1) (4 4 4 3 3 1 1 1) (4 4 4 4 2 1 1 1)
       (5 3 3 2 2 2 2 2) (5 3 3 3 2 2 2 1) (5 3 3 3 3 2 1 1) (5 4 2 2 2 2 2 2)
       (5 4 3 2 2 2 2 1) (5 4 3 3 2 2 1 1) (5 4 3 3 3 1 1 1) (5 4 4 2 2 2 1 1)
       (5 4 4 3 2 1 1 1) (5 4 4 4 1 1 1 1) (5 5 2 2 2 2 2 1) (5 5 3 2 2 2 1 1)
       (5 5 3 3 2 1 1 1) (5 5 4 2 2 1 1 1) (5 5 4 3 1 1 1 1) (5 5 5 2 1 1 1 1)
       (6 3 2 2 2 2 2 2) (6 3 3 2 2 2 2 1) (6 3 3 3 2 2 1 1) (6 3 3 3 3 1 1 1)
       (6 4 2 2 2 2 2 1) (6 4 3 2 2 2 1 1) (6 4 3 3 2 1 1 1) (6 4 4 2 2 1 1 1)
       (6 4 4 3 1 1 1 1) (6 5 2 2 2 2 1 1) (6 5 3 2 2 1 1 1) (6 5 3 3 1 1 1 1)
       (6 5 4 2 1 1 1 1) (6 5 5 1 1 1 1 1) (6 6 2 2 2 1 1 1) (6 6 3 2 1 1 1 1)
       (6 6 4 1 1 1 1 1) (7 2 2 2 2 2 2 2) (7 3 2 2 2 2 2 1) (7 3 3 2 2 2 1 1)
       (7 3 3 3 2 1 1 1) (7 4 2 2 2 2 1 1) (7 4 3 2 2 1 1 1) (7 4 3 3 1 1 1 1)
       (7 4 4 2 1 1 1 1) (7 5 2 2 2 1 1 1) (7 5 3 2 1 1 1 1) (7 5 4 1 1 1 1 1)
       (7 6 2 2 1 1 1 1) (7 6 3 1 1 1 1 1) (7 7 2 1 1 1 1 1) (8 2 2 2 2 2 2 1)
       (8 3 2 2 2 2 1 1) (8 3 3 2 2 1 1 1) (8 3 3 3 1 1 1 1) (8 4 2 2 2 1 1 1)
       (8 4 3 2 1 1 1 1) (8 4 4 1 1 1 1 1) (8 5 2 2 1 1 1 1) (8 5 3 1 1 1 1 1)
       (8 6 2 1 1 1 1 1) (8 7 1 1 1 1 1 1) (9 2 2 2 2 2 1 1) (9 3 2 2 2 1 1 1)
       (9 3 3 2 1 1 1 1) (9 4 2 2 1 1 1 1) (9 4 3 1 1 1 1 1) (9 5 2 1 1 1 1 1)
       (9 6 1 1 1 1 1 1))
66_9: ((3 3 3 2 2 2 2 2 2) (3 3 3 3 2 2 2 2 1) (3 3 3 3 3 2 2 1 1)
       (3 3 3 3 3 3 1 1 1) (4 3 2 2 2 2 2 2 2) (4 3 3 2 2 2 2 2 1)
       (4 3 3 3 2 2 2 1 1) (4 3 3 3 3 2 1 1 1) (4 4 2 2 2 2 2 2 1)
       (4 4 3 2 2 2 2 1 1) (4 4 3 3 2 2 1 1 1) (4 4 3 3 3 1 1 1 1)
       (4 4 4 2 2 2 1 1 1) (4 4 4 3 2 1 1 1 1) (4 4 4 4 1 1 1 1 1)
       (5 2 2 2 2 2 2 2 2) (5 3 2 2 2 2 2 2 1) (5 3 3 2 2 2 2 1 1)
       (5 3 3 3 2 2 1 1 1) (5 3 3 3 3 1 1 1 1) (5 4 2 2 2 2 2 1 1)
       (5 4 3 2 2 2 1 1 1) (5 4 3 3 2 1 1 1 1) (5 4 4 2 2 1 1 1 1)
       (5 4 4 3 1 1 1 1 1) (5 5 2 2 2 2 1 1 1) (5 5 3 2 2 1 1 1 1)
       (5 5 3 3 1 1 1 1 1) (5 5 4 2 1 1 1 1 1) (5 5 5 1 1 1 1 1 1)
       (6 2 2 2 2 2 2 2 1) (6 3 2 2 2 2 2 1 1) (6 3 3 2 2 2 1 1 1)
       (6 3 3 3 2 1 1 1 1) (6 4 2 2 2 2 1 1 1) (6 4 3 2 2 1 1 1 1)
       (6 4 3 3 1 1 1 1 1) (6 4 4 2 1 1 1 1 1) (6 5 2 2 2 1 1 1 1)
       (6 5 3 2 1 1 1 1 1) (6 5 4 1 1 1 1 1 1) (6 6 2 2 1 1 1 1 1)
       (6 6 3 1 1 1 1 1 1) (7 2 2 2 2 2 2 1 1) (7 3 2 2 2 2 1 1 1)
       (7 3 3 2 2 1 1 1 1) (7 3 3 3 1 1 1 1 1) (7 4 2 2 2 1 1 1 1)
       (7 4 3 2 1 1 1 1 1) (7 4 4 1 1 1 1 1 1) (7 5 2 2 1 1 1 1 1)
       (7 5 3 1 1 1 1 1 1) (7 6 2 1 1 1 1 1 1) (7 7 1 1 1 1 1 1 1)
       (8 2 2 2 2 2 1 1 1) (8 3 2 2 2 1 1 1 1) (8 3 3 2 1 1 1 1 1)
       (8 4 2 2 1 1 1 1 1) (8 4 3 1 1 1 1 1 1) (8 5 2 1 1 1 1 1 1)
       (8 6 1 1 1 1 1 1 1) (9 2 2 2 2 1 1 1 1) (9 3 2 2 1 1 1 1 1)
       (9 3 3 1 1 1 1 1 1) (9 4 2 1 1 1 1 1 1) (9 5 1 1 1 1 1 1 1))

#e145 has this distribution: (3 3 3 2 2 2 2 2 2)
it remains to apply the chosen color distribution on the pattern
any subset of the cells of the pattern which is also a subset of a template constitutes a part which can enter into the composition of the puzzle
to find all these parts it is enough to filter the 46656 templates with the cells of the pattern, the intersection of each template with the pattern cells gives a subset of the template which takes into account the context of all the cells i.e. the template does not have any of the other cells of the pattern
this allows you to know all the parts that can compose a puzzle as well as for each part their associated templates.

so for this pattern the only parts of size 2 and 3 available are these:
TP 47 (2 3 ...) indicates the range of the numbers of templates associated with the parts
12:2 ((13 52 74) (13 52 65) ...) indicates there are 12 parts that have 2 associated templates
Hidden Text: Show
Code: Select all
Pattern: (1 6 8 13 18 23 25 30 32 37 42 44 49 52 57 60 62 65 72 73 74)
Color: (3 3 3 2 2 2 2 2 2)
size 3: 606 parts
TP:47 (2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
       29 30 31 32 33 34 35 36 37 38 39 41 42 43 44 45 46 48 52 54)
12:2 ((13 52 74) (13 52 65) (25 32 74) (25 32 65) (18 49 74) (18 49 65)
      (18 32 74) (18 32 65) (25 49 74) (25 49 65) (23 52 74) (23 52 65))
1:3 ((1 44 60))
29:4 ((23 49 74) (23 49 65) (13 30 72) (13 30 74) (13 30 65) (49 72 74)
      (23 30 72) (23 30 74) (23 30 65) (32 72 74) (18 30 74) (18 30 65)
      (8 30 60) (13 52 72) (32 52 74) (32 52 65) (13 72 74) (18 23 74)
      (18 23 65) (18 52 74) (18 52 65) (13 32 74) (13 32 65) (23 72 74)
      (13 25 74) (13 25 65) (25 30 74) (25 30 65) (6 30 62))
6:5 ((23 30 62) (30 44 60) (8 37 60) (18 30 60) (25 32 72) (30 42 62))
9:6 ((23 30 60) (23 30 52) (1 42 62) (1 44 72) (18 30 62) (6 37 62) (18 23 30)
     (13 32 72) (23 52 72))
18:7 ((13 30 62) (32 60 72) (1 42 72) (1 30 44) (1 44 74) (18 30 49) (13 52 73)
      (1 13 72) (1 52 74) (1 52 60) (13 60 72) (30 49 72) (52 60 74) (25 30 60)
      (25 30 72) (25 49 72) (44 60 74) (23 52 73))
18:8 ((1 60 72) (13 30 52) (30 72 74) (37 60 72) (1 42 52) (1 30 72) (30 52 74)
      (30 52 65) (13 37 72) (6 37 72) (25 72 74) (25 32 73) (30 49 74)
      (30 49 65) (1 32 72) (6 30 72) (44 60 73) (52 72 74))
27:9 ((23 49 72) (6 52 74) (49 60 72) (1 30 42) (8 37 72) (1 44 65) (1 44 49)
      (8 60 72) (1 23 52) (37 52 60) (13 52 57) (13 72 73) (25 32 57)
      (25 37 60) (30 42 72) (32 37 72) (23 60 72) (8 52 60) (6 44 73) (6 44 74)
      (18 49 73) (25 30 49) (25 49 73) (1 49 72) (13 25 30) (44 60 72)
      (23 52 57))
21:10 ((13 30 60) (23 30 73) (32 72 73) (1 23 30) (1 23 44) (8 30 72)
       (13 52 60) (23 37 60) (1 13 52) (32 52 57) (18 52 73) (18 37 60)
       (25 44 60) (6 44 72) (18 49 57) (18 32 73) (18 32 57) (25 30 62)
       (1 32 62) (6 30 44) (1 32 60))
20:11 ((1 60 74) (1 42 74) (42 52 73) (42 52 74) (30 52 62) (30 52 60)
       (8 60 74) (18 30 73) (1 25 60) (1 52 65) (32 57 72) (13 44 60)
       (30 49 62) (30 49 60) (13 25 72) (8 52 74) (52 60 73) (25 30 73)
       (25 49 57) (13 57 72))
31:12 ((23 49 73) (13 30 73) (49 72 73) (6 52 73) (1 30 52) (1 25 32)
       (13 37 52) (8 30 42) (1 13 44) (1 13 62) (23 37 72) (6 37 52) (32 52 72)
       (18 23 57) (1 52 62) (32 37 62) (1 18 49) (25 60 72) (1 18 52) (1 18 30)
       (18 37 62) (1 18 60) (13 44 72) (13 32 73) (6 44 65) (6 44 57)
       (52 60 72) (13 25 57) (1 49 62) (1 49 60) (8 42 72))
17:13 ((49 57 72) (23 44 60) (23 57 72) (23 30 44) (1 25 30) (8 60 73)
       (1 23 72) (1 25 42) (23 37 52) (25 32 60) (25 32 37) (1 52 72)
       (23 72 73) (18 49 60) (1 32 44) (23 52 62) (23 52 60))
26:14 ((30 72 73) (44 49 73) (44 49 74) (6 52 62) (1 42 65) (8 32 60)
       (30 52 72) (13 37 62) (13 37 60) (23 37 62) (13 52 62) (1 13 30)
       (18 23 49) (18 23 52) (13 42 72) (25 60 74) (1 18 42) (25 44 74)
       (13 32 52) (13 25 32) (18 49 62) (18 32 62) (18 32 37) (18 44 60)
       (1 49 74) (44 60 65))
11:15 ((44 49 72) (23 30 49) (6 52 65) (1 30 49) (1 44 57) (1 25 49) (8 49 60)
       (52 60 65) (1 32 52) (37 49 72) (8 23 30))
31:16 ((23 44 74) (6 32 72) (6 32 62) (8 32 72) (8 32 37) (49 60 74) (1 25 74)
       (1 25 72) (8 49 74) (6 18 37) (30 52 73) (1 23 49) (1 23 62) (18 30 42)
       (18 30 52) (6 25 37) (32 52 73) (32 52 60) (25 32 62) (1 18 32)
       (18 42 62) (18 37 49) (13 44 74) (13 25 73) (8 52 73) (18 32 60)
       (18 32 52) (25 42 74) (23 42 52) (8 42 73) (8 42 74))
16:17 ((1 60 65) (44 49 65) (42 52 65) (1 25 44) (6 18 30) (1 13 32) (18 23 60)
       (18 23 62) (18 52 60) (25 44 73) (25 44 57) (8 13 52) (13 32 37)
       (8 52 57) (25 30 44) (1 49 65))
15:18 ((1 62 74) (1 62 65) (23 44 73) (37 60 74) (30 60 74) (32 52 62)
       (18 23 73) (1 72 74) (6 49 62) (25 37 49) (18 37 52) (13 44 73)
       (30 49 73) (13 32 57) (25 42 73))
25:19 ((49 62 74) (49 62 65) (44 49 60) (30 44 72) (8 37 52) (8 60 65)
       (37 52 74) (37 52 72) (6 25 74) (52 62 74) (52 62 65) (6 37 74)
       (6 49 74) (25 37 74) (25 37 72) (32 37 60) (6 62 74) (6 62 65)
       (25 44 49) (13 44 65) (13 25 60) (8 52 65) (18 44 49) (25 49 62)
       (25 49 60))
26:20 ((8 23 37) (23 49 57) (32 60 74) (6 52 57) (18 60 74) (18 60 65)
       (8 49 65) (1 23 74) (1 13 74) (52 57 72) (18 23 37) (25 32 44) (6 49 72)
       (13 60 74) (25 57 72) (1 18 74) (1 18 65) (25 60 73) (18 52 57)
       (23 60 74) (13 32 62) (1 32 74) (52 72 73) (8 42 65) (8 42 52) (8 42 57))
11:21 ((23 44 65) (23 44 49) (23 44 57) (8 32 74) (8 49 72) (1 23 60)
       (13 42 62) (18 42 74) (18 42 65) (13 25 37) (23 42 72))
20:22 ((44 72 74) (30 44 74) (1 42 57) (42 52 72) (1 25 65) (37 52 62)
       (8 30 52) (1 13 65) (23 37 74) (6 37 57) (25 72 73) (13 62 74)
       (13 62 65) (25 37 62) (1 18 44) (1 18 62) (6 62 73) (13 25 44)
       (37 49 62) (8 23 72))
26:23 ((23 49 62) (13 30 42) (32 44 60) (49 60 65) (8 37 74) (42 52 62)
       (1 13 60) (23 37 49) (6 25 73) (6 25 30) (6 37 65) (42 62 74) (42 62 65)
       (13 42 52) (1 52 57) (32 62 74) (32 62 65) (18 37 74) (18 37 65)
       (8 13 72) (8 13 74) (8 13 37) (8 13 30) (13 25 62) (1 32 65) (23 42 74))
44:24 ((32 44 74) (18 62 74) (18 62 65) (23 44 72) (6 32 74) (37 72 74)
       (44 72 73) (6 52 72) (8 32 57) (8 49 73) (6 18 74) (6 18 65) (1 23 65)
       (6 72 74) (8 30 73) (13 37 74) (8 30 74) (6 25 44) (30 60 73) (30 60 65)
       (6 49 65) (13 42 74) (30 42 74) (32 37 74) (25 60 65) (18 42 73)
       (25 44 65) (42 72 74) (13 44 57) (6 44 49) (18 44 74) (18 44 65)
       (25 30 42) (30 62 74) (30 62 65) (6 30 73) (6 30 74) (23 62 74)
       (23 62 65) (8 72 74) (25 42 65) (23 42 62) (8 23 74) (8 23 52))
6:25 ((13 30 44) (23 30 42) (8 32 65) (8 37 57) (42 62 73) (18 42 52))
5:26 ((6 32 37) (37 60 65) (8 32 73) (13 60 65) (6 30 52))
18:27 ((32 60 65) (32 44 72) (8 32 52) (8 37 65) (8 37 49) (8 49 57) (6 18 62)
       (1 23 42) (37 52 65) (13 37 65) (23 37 65) (6 25 65) (25 37 65)
       (32 37 65) (42 72 73) (8 13 65) (37 49 60) (25 42 72))
22:28 ((6 57 72) (32 44 73) (32 44 57) (30 44 65) (42 52 57) (6 18 32)
       (6 18 52) (6 72 73) (18 30 44) (8 30 49) (8 30 65) (1 13 42) (6 25 72)
       (13 42 65) (30 42 65) (23 60 65) (18 44 73) (6 30 65) (42 57 72)
       (8 72 73) (23 42 73) (8 23 65))
12:29 ((32 44 65) (6 32 65) (6 32 57) (44 49 57) (30 44 73) (18 60 73)
       (6 18 73) (6 25 49) (1 32 57) (25 42 62) (23 42 65) (8 23 60))
11:30 ((6 32 52) (49 60 73) (6 49 73) (13 42 73) (18 42 57) (23 60 73)
       (8 13 73) (8 13 60) (6 30 49) (25 42 57) (8 23 73))
2:31 ((37 62 74) (37 62 65))
11:32 ((32 60 73) (6 32 73) (25 62 74) (25 62 65) (1 25 62) (1 57 72)
       (13 60 73) (30 42 73) (37 57 72) (37 49 74) (30 62 73))
10:33 ((49 62 73) (6 18 49) (37 52 57) (23 37 57) (52 62 73) (6 49 57)
       (13 62 73) (25 37 57) (32 37 52) (8 23 49))
12:34 ((6 32 44) (6 18 44) (6 25 32) (1 13 25) (18 23 42) (18 23 44) (32 62 73)
       (18 37 57) (8 13 32) (13 32 44) (13 25 42) (18 44 57))
5:35 ((8 23 57) (13 42 57) (18 52 62) (1 49 57) (23 42 57))
2:36 ((1 18 23) (8 13 57))
5:37 ((13 37 57) (37 49 65) (23 62 73) (8 57 72) (44 57 72))
9:38 ((18 62 73) (60 72 74) (1 30 74) (6 18 57) (6 25 57) (6 37 49) (32 37 57)
      (13 32 60) (18 32 44))
1:39 ((8 52 72))
2:41 ((23 49 60) (6 25 62))
1:42 ((1 23 57))
2:43 ((1 25 57) (25 44 72))
3:44 ((1 30 65) (1 13 57) (1 18 57))
1:45 ((30 42 52))
1:46 ((30 44 49))
2:48 ((8 13 42) (8 23 42))
1:52 ((60 72 73))
2:54 ((25 62 73) (37 49 57))

size 2: 164 parts
TP:78 (28 32 33 35 36 37 38 39 40 41 42 43 44 48 49 50 52 53 54 55 56 57 58 59
       62 63 64 68 71 72 73 74 75 79 80 81 82 83 84 86 87 88 89 91 92 93 94 96
       97 98 101 102 103 104 105 106 107 108 111 118 122 123 127 128 129 130
       131 145 146 147 150 155 157 158 162 163 170 180)
1:28 ((52 74))
2:32 ((30 62) (30 60))
1:33 ((13 72))
2:35 ((13 52) (23 52))
4:36 ((52 65) (49 74) (25 74) (30 72))
1:37 ((32 72))
2:38 ((13 74) (23 74))
1:39 ((23 30))
6:40 ((18 74) (49 65) (49 72) (1 44) (32 74) (18 65))
1:41 ((18 49))
4:42 ((13 65) (1 60) (44 60) (23 65))
3:43 ((25 32) (18 30) (23 72))
4:44 ((37 60) (60 72) (32 65) (25 65))
3:48 ((18 32) (1 72) (25 49))
1:49 ((1 52))
1:50 ((25 30))
2:52 ((1 30) (1 62))
1:53 ((13 30))
1:54 ((52 73))
1:55 ((1 42))
4:56 ((72 74) (30 74) (52 72) (37 72))
1:57 ((52 60))
1:58 ((6 44))
1:59 ((8 60))
1:62 ((37 62))
1:63 ((25 72))
3:64 ((30 65) (6 37) (18 52))
2:68 ((6 62) (32 52))
2:71 ((23 49) (25 73))
2:72 ((1 32) (30 52))
1:73 ((1 49))
3:74 ((18 23) (13 32) (52 57))
3:75 ((8 37) (18 60) (13 25))
5:79 ((37 52) (25 37) (30 49) (42 72) (42 62))
5:80 ((6 72) (32 62) (23 73) (44 74) (18 37))
1:81 ((25 60))
4:82 ((49 73) (8 30) (13 73) (23 37))
2:83 ((32 57) (18 73))
3:84 ((6 30) (1 25) (32 73))
1:86 ((1 18))
4:87 ((52 62) (13 62) (44 73) (49 62))
3:88 ((13 37) (44 72) (6 52))
5:89 ((60 74) (1 74) (1 13) (1 23) (32 37))
3:91 ((32 60) (23 62) (23 57))
2:92 ((30 44) (18 62))
2:93 ((49 57) (13 57))
3:94 ((25 57) (30 73) (18 57))
2:96 ((49 60) (8 42))
4:97 ((13 60) (8 72) (23 60) (42 52))
1:98 ((72 73))
1:101 ((8 52))
2:102 ((44 65) (30 42))
1:103 ((6 74))
1:104 ((44 49))
1:105 ((13 44))
2:106 ((23 44) (25 44))
3:107 ((1 65) (8 74) (42 74))
1:108 ((57 72))
1:111 ((44 57))
2:118 ((60 73) (42 73))
1:122 ((6 73))
1:123 ((37 49))
2:127 ((60 65) (6 65))
2:128 ((25 42) (25 62))
1:129 ((8 49))
3:130 ((8 32) (8 73) (18 42))
5:131 ((37 74) (42 65) (62 65) (8 65) (62 74))
1:145 ((8 57))
1:146 ((18 44))
1:147 ((32 44))
1:150 ((6 57))
1:155 ((37 65))
2:157 ((6 25) (6 18))
3:158 ((6 32) (42 57) (6 49))
1:162 ((8 13))
3:163 ((8 23) (13 42) (23 42))
1:170 ((1 57))
2:180 ((37 57) (62 73))

all puzzles that have this pattern and color distribution are compositions of these parts
here the parts of #e145 and the number of corresponding templates, they are easily found in the previous table.
Code: Select all
((1 60 65) (23 52) (18 49) (25 32) (30 44) (6 37 74) (13 72) (8 42 57) (62 73))
#VT: (17 35 41 43 92 19 33 20 180)

the colored pattern: #e145
1  .  .  .  .  6  .  8  .
.  .  .  7  .  .  .  .  3
.  .  .  .  2  .  4  .  .
.  .  5  .  4  .  .  .  .
6  .  .  .  .  8  .  5  .
.  .  .  3  .  .  2  .  .
.  .  8  .  .  1  .  9  .
.  1  .  .  .  .  .  .  7
9  6  .  .  .  .  .  .  .

the first 12 single-solution puzzles that i found just scratching the surface
Hidden Text: Show
Code: Select all
((18 30 65) (13 52 74) (1 44 60) (32 72) (25 49) (37 62) (23 73) (8 42) (6 57))
#VT: (4 2 3 37 48 62 80 96 150)
3....9.8....2....1....7.5....1.4....6....8.3....5..2....9..3.6..1......472.......

((1 52 60) (25 32 74) (18 49 65) (30 62) (13 72) (6 44) (8 37) (23 73) (42 57))
#VT: (7 2 2 32 33 58 75 80 158)
1....6.7....5....3....8.2....4.2....7....9.6....3..1....9..1.4..3......582.......

((1 60 72) (13 52 74) (25 32 65) (30 62) (18 49) (6 44) (8 37) (23 73) (42 57))
#VT: (8 2 2 32 41 58 75 80 158)
1....6.7....2....5....8.3....4.3....7....9.6....5..2....9..1.4..3......182.......

((1 42 52) (25 32 74) (18 49 65) (30 62) (13 72) (44 60) (6 37) (23 73) (8 57))
#VT: (8 2 2 32 33 42 64 80 145)
1....7.9....5....3....8.2....4.2....7....1.6....3..1....9..6.4..3......582.......

((6 30 72) (13 52 74) (25 32 65) (1 44) (18 49) (37 60) (42 62) (23 73) (8 57))
#VT: (8 2 2 40 41 44 79 80 145)
4....1.9....2....5....8.3....1.3....6....7.4....5..2....9..6.7..3......182.......

((25 32 57) (13 52 74) (18 49 65) (30 62) (1 44) (23 72) (37 60) (8 42) (6 73))
#VT: (9 2 2 32 40 43 44 96 122)
5....9.8....2....3....6.1....4.1....7....8.5....3..2....1..7.4..3......692.......

((8 52 60) (25 32 74) (18 49 65) (30 62) (13 72) (1 44) (6 37) (23 73) (42 57))
#VT: (9 2 2 32 33 40 64 80 158)
6....7.1....5....3....8.2....4.2....7....9.6....3..1....9..1.4..3......582.......

((8 42 73) (13 52 74) (25 32 65) (30 62) (49 72) (1 44) (37 60) (18 23) (6 57))
#VT: (16 2 2 32 40 40 44 74 150)
6....9.1....2....8....8.3....4.3....7....1.6....5..2....9..7.4..3......512.......

((1 25 44) (13 52 74) (18 49 65) (30 62) (32 72) (37 60) (23 73) (8 42) (6 57))
#VT: (17 2 2 32 37 44 80 96 150)
1....9.8....2....3....7.1....4.5....6....8.1....3..2....9..6.4..3......572.......

((25 37 62) (13 52 74) (18 49 65) (30 60) (32 72) (1 44) (23 73) (8 42) (6 57))
#VT: (22 2 2 32 37 40 80 96 150)
6....9.8....2....3....7.1....4.5....1....8.6....3..2....9..4.1..3......572.......

((6 32 73) (13 52 74) (18 49 65) (30 62) (1 44) (23 72) (37 60) (25 57) (8 42))
#VT: (32 2 2 32 40 43 44 94 96)
5....1.9....2....3....6.8....4.1....7....9.5....3..2....8..7.4..3......612.......

((44 57 72) (13 52 74) (25 32 65) (30 62) (18 49) (1 60) (6 37) (23 73) (8 42))
#VT: (37 2 2 32 41 42 64 80 96)
6....7.9....2....5....8.3....4.3....7....9.1....5..2....1..6.4..3......182.......
P.O.
 
Posts: 1759
Joined: 07 June 2021

Re: from pattern to puzzle

Postby Serg » Sun Oct 08, 2023 4:01 pm

Hi, P.O.!
Interesting approach. But if we say about exhaustive search of all puzzles for given pattern, it seems to me this approach has the same performance as simple algorithm of puzzles' generation by backtracking.

Serg
Serg
2018 Supporter
 
Posts: 890
Joined: 01 June 2010
Location: Russia

Re: from pattern to puzzle

Postby P.O. » Sun Oct 08, 2023 6:43 pm

hi Serg
my system is extremely slow, any idea of an exhaustive search is out of the question for me.
perhaps the advantage of this approach is to have knowledge of the number of templates associated with each part and thus to be able to direct the research in certain directions.
what interests me is finding puzzles that are in 6-template or more, if more than 6 is only possible which i doubt a little.
here are nine 6-template puzzles from eleven’s collection, to combine parts in these ranges of values is perhaps interesting.
Code: Select all
e11  #VT: (39 50 62 8 24 95 28 43 31)
e13  #VT: (69 49 70 56 14 66 11 28 57)
e25  #VT: (12 36 97 37 38 58 54 116 14)
e38: #VT: (60 6 11 42 110 56 38 49 49)
e42  #VT: (38 39 47 30 56 16 58 42 10)
e45: #VT: (16 73 6 40 19 34 36 34 33)
e56: #VT: (68 57 96 47 42 9 26 20 33)
e64: #VT: (102 49 20 15 44 39 48 23 38)
e77  #VT: (42 37 18 66 51 42 10 41 10)

on the other hand for a given pattern and a given color distribution the arrangement of the colors on the puzzle is what fixes its characteristics: its number of solutions, its level of difficulty, i find it interesting to explore this aspect.
P.O.
 
Posts: 1759
Joined: 07 June 2021

Re: from pattern to puzzle

Postby yzfwsf » Tue Oct 10, 2023 10:57 am

I test a 23 clues pattern. Checking only "ab" type UR takes 40 minutes. About 7% of non-overlapping template pairs have URs.
yzfwsf
 
Posts: 921
Joined: 16 April 2019

Re: from pattern to puzzle

Postby P.O. » Tue Oct 10, 2023 6:45 pm

if i understand correctly it is the idea of using the UA technique early on combinations of templates smaller than 9 in order to select parts which lead to single-solution puzzles.
it’s certainly an idea to consider but as you point out it’s costly in terms of time.

regarding the strategy that i have outlined
to give an idea of the number of combinations to test to be exhaustive
parts are compatible when they are pairwise disjoint
for the example i gave i counted 7 962 777 compatible parts of size 3 and 700 183 343 compatible parts of size 2
to be exhaustive it amounts to composing and testing 5 575 403 819 423 511 parts of size 9

i hope i was wrong in my calculations.
P.O.
 
Posts: 1759
Joined: 07 June 2021


Return to General