Sunteți pe pagina 1din 2

(cand,r,c)

(1,1,1)
(2,1,1)
(3,1,1)
(4,1,1)
(1,1,2)
(2,1,2)
(3,1,2)
(4,1,2)
(1,1,3)
(2,1,3)
(3,1,3)
(4,1,3)
(1,1,4)
(2,1,4)
(3,1,4)
(4,1,4)
(1,2,1)
(2,2,1)
(3,2,1)
(4,2,1)
(1,2,2)
(2,2,2)
(3,2,2)
(4,2,2)
(1,2,3)
(2,2,3)
(3,2,3)
(4,2,3)
(1,2,4)
(2,2,4)
(3,2,4)
(4,2,4)
(1,3,1)
(2,3,1)
(3,3,1)
(4,3,1)
(1,3,2)
(2,3,2)
(3,3,2)
(4,3,2)
(1,3,3)
(2,3,3)
(3,3,3)
(4,3,3)
(1,3,4)
(2,3,4)
(3,3,4)
(4,3,4)
(1,4,1)
(2,4,1)
(3,4,1)
(4,4,1)
(1,4,2)
(2,4,2)
(3,4,2)
(4,4,2)
(1,4,3)
(2,4,3)
(3,4,3)
(4,4,3)
(1,4,4)
(2,4,4)
(3,4,4)
(4,4,4)

1
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64

row 1
row 2
row 3
row 4
row 1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

row 2
row 3
row 4
col 1
col 2
co3
col 4
region 1
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

Each row represents a possible candidate in a possible position - a possible solution to the puzzle
Each column is a representation of that candidates constraints by the rules of sudoku -> row, col, region
Given the initial solutions, there will only be so many rows that will solve the exact cover problem.
The final solution will combine the rows into one, and each column will have one 1

region 2
region 3
region 4
53 54 55 56 57 58 59 60 61 62 63 64

1
1
1
1
1
1
1
1

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

The Exact Cover Representation of a 4x4 Sudoku Puzzle


(cand,r,c)
(1,1,1)
(2,1,1)
(3,1,1)
(4,1,1)
(1,1,2)
(2,1,2)
(3,1,2)
(4,1,2)
(1,1,3)
(2,1,3)
(3,1,3)
(4,1,3)
(1,1,4)
(2,1,4)
(3,1,4)
(4,1,4)
(1,2,1)
(2,2,1)
(3,2,1)
(4,2,1)
(1,2,2)
(2,2,2)
(3,2,2)
(4,2,2)
(1,2,3)
(2,2,3)
(3,2,3)
(4,2,3)
(1,2,4)
(2,2,4)
(3,2,4)
(4,2,4)
(1,3,1)
(2,3,1)
(3,3,1)
(4,3,1)
(1,3,2)
(2,3,2)
(3,3,2)
(4,3,2)
(1,3,3)
(2,3,3)
(3,3,3)
(4,3,3)
(1,3,4)
(2,3,4)
(3,3,4)
(4,3,4)
(1,4,1)
(2,4,1)
(3,4,1)
(4,4,1)
(1,4,2)
(2,4,2)
(3,4,2)
(4,4,2)
(1,4,3)
(2,4,3)
(3,4,3)
(4,4,3)
(1,4,4)
(2,4,4)
(3,4,4)
(4,4,4)

1
2
3
4
5
6
7
8
9
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#

row 1
row 2
row 3
row 4
row 1
1 2 3 4 5 6 7 8 9 # # # # # # # # # # #
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

row 2
row 3
row 4
col 1
col 2
co3
col 4
region 1
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

Each row represents a possible candidate in a possible position - a possible solution to the puzzle
Each column is a representation of that candidates constraints by the rules of sudoku -> row, col, region
Given the initial solutions, there will only be so many rows that will solve the exact cover problem.
The final solution will combine the rows into one, and each column will have one 1

region 2
region 3
region 4
# # # # # # # # # # # #

1
1
1
1
1
1
1
1

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

S-ar putea să vă placă și