Professional Documents
Culture Documents
www.sjmmf.org
Abstract
In the last few years, there has been explosive growth in the
application of meta-heuristics algorithm for solving Sudoku
puzzles in computer science. In this paper we present a
hybrid genetic algorithm (HGA) that uses a random
technology to improve the performance of genetic
algorithm. We also show the performance of the algorithms
for solving Sudoku puzzles with 46 different examples. The
experimental results indicate that HGA is able to produce
very competitive results with respect to meta-heuristics
algorithm at a considerably lower computational cost.
Keywords
Sudoku; Hybrid Genetic Algorithm; Metaheuristics Algorithm;
Optimization; Random Search Strategy
Introduction
Sudoku
Related Work
25
www.sjmmf.org
wi = (r j + c j )
(1)
j =1
Where
rj
while
cj
000500000
300400700
035609080
051302008
000000023
www.sjmmf.org
i=
037080052
900823006
000100000
100100100
011101010
011101001
000000011
011010011
100111001
2k 5
11
16
21
6 k 10
11 k 15
16 k 21
namely:
x , x , , xiG9 . Set
G
i1
G
i2
www.sjmmf.org
The x1 , xb , x s
G
performe
xiG +1 , namely
xiG +1 = ( x1G xbG ) x sG , i = 2 , 3 , , 21 (2)
Where and
cross-
x x
G
1
G
b
is denoted by x
G
t
= [ x , x ,, x ] ,
G
t1
G
t2
G
t9
x
xtkG =
x1Gk
G
bju
k { j1 , j 2 , , j } , u = 1,2, ,
x srG
xikG +1 = v
xtkG
otherwise
k { r1 , r2 , , r } , v = 1,2, ,
otherwise
1
rand int ( 1 , 1 , [1,5] )
i=
rand int ( 1 , 1 , [1,8] )
rand int ( 1 , 1 , [1,3] )
Mutation Operation
G=G+1
28
www.sjmmf.org
29
www.sjmmf.org
30
www.sjmmf.org
TABLE 1 COMPARISON OF HOW MANY GENERATION IS NEEDED TO SOLVE SUDOKUS WITH DIFFERENT METHODS
GA
CA
ACO
GA/ACO Hybrid
HGA
192
181
956
178
222
868
28
21
54
233
199
742
299
213
731
1237
2985
1017
1020 2024
933
91
89
47
884
1516
707
871
898
945
1460
3025
1209
1105 1994
949
63
107
76
801
1722
849
853
954
583
987
2001
1927
754
1557 1765
68
84
78
839
1095
1085
1033
529 ------
945
1154
1363
823
946
1071
69
78
92
883
847
1162
------
738
196
201
171
256
199
213
250
32
57
41
171
291
218
129
136
165
2825 1976
2892
100
70
96
1505 1152
1346
478
791
561
4362 3274
5902
149
95
82
2658 1722
1872
-----
------
------
SD
3887 3872
4637
135
121
113
2803 2407
2573
------ ------
-----
Easy
1742 604
374
1157 497
363
109
32
37
667
307
882
779
Med.
90
103
127
1652 1605
1877
465
------ 1143
Hard
145
90
128
3359 1041
2546
------
100
------
GA-E
292
558
261
215
494
220
27
36
22
267
435
184
482
550
561
GA-M
979
370
708
732
330
540
57
44
61
704
409
653
672
225
117
101
94
183
1453
1230
3905
-----
------ ------
352
303
GA-H
AI_E
18362
11944
212
5670
------
Avg.
2261.74
1642.94
83.35
1317.35
560.71
TABLE 2 COMPARISON OF NUMBER OF RUNS , OUT of 100 RUNS , THAT SUDOKUS WERE SOLVED WITHOUT REINITIALIZATION
GA
CA
ACO
GA/ACO Hybrid
HGA
58
68
48
56
76
46
70
54
41
48
53
42
100
100
100
41
22
31
42
22
22
10
23
30
21
26
27
100
79
90
34
15
16
42
19
17
22
18
11
87
88
100
11
13
69
89
94
12
10
10
85
71
82
83
77
72
86
69
74
54
79
44
67
59
100 100
58
100
33
10
17
27
22
12
21
31
23
96
85
98
11
22
11
13
25
14
18
15
47
SD
Easy
34
62
50
39
60
55
58
62
48
37
53
39
100
99
100
Med.
10
29
13
26
11
15
25
96
100
94
63
Hard
10
GA-E
37
52
35
28
52
36
43
39
16
23
29
16
97
99
100
GA-M
14
11
15
11
11
90
92
94
GA-H
AI_E
Avg.
34.27
3
33.13
27.3
41.62
8
45.17
31
www.sjmmf.org
ACKNOWLEDGMENT
Sudoku
online.
Available
via
WWW:
Sudoku.
Available
via
http://www2.hs.fi/extrat/sudoku/sudoku.html(cited11.1.2
006).
History of Dell Magazines. http://www.dellmagazines.com/.
Inkala, A. AI Sudoku 1002 Vaikeaa Tehtv, Pressmen Oy,
2006.
Lewis, R. Metaheuristics can solve Sudoku Puzzles,
Journal of Heuristics, p.387-401, 2007.
Lucas, S. and Kendall, G. Evolutionary computation and
games, IEEE Computational Intelligence Magazine, 1(1),
p.108, 2006.
Mantere,T. and Koljonen, J. Ant Colony Optimization
and a Hybrid Genetic Algorithms for Sudoku Solving,In:
32
on
Evolutionary
Computation-
IEEE
Helsingin
REFERENCES
Aamulehti:
Su|do|ku.
Available
via
WWW:
Solver
by
Logic
v1.4.
http://www.sudokusolver.co.uk/. (Javascript)
Sudokulist. http://www.sudokulist.com/. (Step by step
solver, with hints at each step.)
Yato, T. and Seta, T. Complexity and Completeness of
Finding Another Solution and Its Application to
Puzzles, IEICE Trans. Fundamentals, E86-A (5), p.1052
1060, 2003.