Document not found! Please try again

Application of New Hybrid Harmony Search Algorithms ... - Springer Link

13 downloads 679 Views 812KB Size Report
mony search (CHS) and smallest-small-world cellular harmony search (SSWCHS) for solving magic ... SSWCHS in combinatorial optimization problems of magic square problems. Furthermore ... optimization results using the proposed hybrid methods with other optimization engines. Finally ..... New York (1942). 4. Abe, G.: ...
Application of New Hybrid Harmony Search Algorithms Based on Cellular Automata Theory for Solving Magic Square Problems Do Guen Yoo, Ali Sadollah, Joong Hoon Kim and Ho Min Lee

Abstract Magic square construction is a complex and hard permutation problem of recreational combinatorics with a long history. The complexity level enhances rapidly when the number of magic squares increases with the order of magic square. This paper proposes two hybrid metaheuristic algorithms, so-called cellular harmony search (CHS) and smallest-small-world cellular harmony search (SSWCHS) for solving magic square problems. The inspiration of the CHS is based on the cellular automata (CA) formation, while the SSWCHS is inspired by the structure of smallest-small-world network (SSWN) and CA using the concept of HS. Numerical optimization results obtained are compared with different optimizers in terms of statistical results and number of found feasible solutions. Computational results show that the proposed hybrid optimizers are computationally effective and highly efficient for tackling magic square problems.



Keywords Magic square Harmony search problem Combinatorial optimization





Metaheuristics



Feasibility

D. Guen Yoo (&)  A. Sadollah  J.H. Kim  H.M. Lee School of Civil, Environmental and Architectural Engineering, Korea University, Seoul 136-713, Republic of Korea e-mail: [email protected] A. Sadollah e-mail: [email protected] J.H. Kim e-mail: [email protected] H.M. Lee e-mail: [email protected] © Springer India 2015 K.N. Das et al. (eds.), Proceedings of Fourth International Conference on Soft Computing for Problem Solving, Advances in Intelligent Systems and Computing 335, DOI 10.1007/978-81-322-2217-0_21

245

246

D. Guen Yoo et al.

1 Introduction Magic squares have been a popular topic in recreational mathematics, papers, and books for generations. Magic squares have appeared in astrology, jewelry, paintings, carvings, and so forth. Magic squares have been investigated in an attempt to create them and better understanding of their interesting properties. A brief history of the magic square includes the earliest known example dating back to 650 BC in China [1]. In nineteenth century, mathematicians applied the magic squares in probability and analysis problems [2]. For instance, attractive patterns may be obtained by connecting consecutive numbers in some special classes of magic squares. Nowadays, magic squares are studied in relation to factor analysis, combinatorial mathematics, matrices, modular arithmetic, and geometry. In the times of information technology, magic squares have found many practical applications in artificial intelligence, graph theory, game theory, electronic circuits, and, etc., and probably will be extended to more innovated applications. Kraitchik [3] developed several general deterministic techniques for constructing even and odd squares of order n. These deterministic methods cannot construct any other possible magic squares with additional properties [4, 5]. Essentially, differing from the deterministic methods, this paper investigated the application of stochastic optimization methods based on the concept of the cellular automata formation and the topological structure of smallest-small-world network. Recently, metaheuristic optimization methods are widely used in problem solving era [6]. Among optimization methods, many researchers are interested in these stochastic approaches due to their simplicity and efficiency for tackling complex optimization problem such as combinatorial problems [7]. Im et al. [8] recently developed two hybrid methods that utilize the concepts of cellular automata formation along with the smallest-small-world theory, named as CHS and SSWCHS. The HS is inspired based on musical performance processes that occur when a musician searches for a better state of harmony [9]. The CHS and SSWCHS were successfully applied for continuous optimization problems [8]. This study compares the relative performance of the CHS and SSWCHS in combinatorial optimization problems of magic square problems. Furthermore, the efficiency of the proposed improved algorithms is compared with optimization results obtained by other existing optimizers. The main goal of this paper is to generate possible solution of 3 by 3 and 4 by 4 magic squares using the CHS and SSWCHS. The remainder of this paper is organized as follows: The next section describes magic square problem formulation and its optimization model. In Sect. 3, the proposed CHS and SSWCHS approaches along with their processes are explained in brief. Section 4 compares statistical optimization results using the proposed hybrid methods with other optimization engines. Finally, conclusions are drawn in Sect. 5.

Application of New Hybrid Harmony Search Algorithms …

247

2 Magic Square Problems A magic square is an arrangement of distinct and integer numbers (i.e., each number is used once), in a square grid, where the numbers in each row and in each column, and the numbers in the forward and backward main diagonals, all add up to the same number. Indeed, the magic square is a square matrix of order n. Therefore, a magic square always contains n2 numbers, and its size is defined as being “of order n” [10]. The constant that is the sum of every row, column, and diagonals (i.e., main and minor diagonals) is called the magic constant or magic sum, M. Every normal magic square has a unique constant determined solely by the value of n, which can be calculated using the following equation [11]: M¼

nðn2 þ 1Þ 2

ð1Þ

In optimization point of view, magic square problems classified as satisfiability problem, also called the feasibility problem, is just the problem of finding any feasible solution at all without regard to objective value. This can be regarded as the special case of mathematical optimization where the objective value is the same for every solution, and thus, any solution is optimal. Therefore, in order to solve magic square problems having n order, the following optimization model is suggested as follows [12]: 8i; j 2 f1; 2; . . .; N g subject to: N P xij ¼ M g1 : g2 : g3 : g4 :

i¼1 N P j¼1 N P i¼1 N P

xij ¼ M

  All different xij 8j 2 f1; 2; . . .; N g 8i 2 f1; 2; . . .; N g

ð2Þ

xii ¼ M xiðNiþ1Þ ¼ M

i¼1

where g1 and g2 denote constraints of any violations in horizontal and vertical lines, respectively. g3 and g4 represent constraints of any violations in major and minor diagonals. In this study, we tackled the magic squares having order 3 and 4 (n = 3 and 4). Further statistical analysis reveals that the number of magic squares increases exponentially with the order; therefore, the difficulty of searching a magic square also dramatically increases [13]. It is worth pointing out that there is no known deterministic algorithm for generating even-order normal magic squares. However, there are some methods for creating magic squares of specific even orders [14].

248

D. Guen Yoo et al.

3 Proposed Hybrid Methods In this section, we proposed two improved variations of HS that use the CA and topological structure concept (i.e., CHS) [8, 15, 16] and, in addition of having CA feature, has the shortest path of the smallest-small-world network (SSWN) (i.e., SSWCHS) [8, 17]. A population is just a group of certain number of arbitrary objects in the same harmony memory as for the harmony memory (HM) in the original HS. Meanwhile, these objects are not related to each other. In the configuration of these populations as a kind of random network, the characteristic path length (L) and clustering coefficient (C) are also very low. This is a characteristic of original HS. In contrast, if the population only consists of a grid of cellular networks, the C is relatively high, however, the L is also high. Since high L makes the interactions of remote nodes difficult, therefore, we need to reduce the L. The SSWN models have advantages of both random and regular networks. They have low L for fast interaction between nodes, and also high C ensuring sufficient redundancy for high fault tolerance [17]. In this study, the population of the original HS [9] (i.e., HM) consists of a form of cellular networks (i.e., CHS). In addition, we can reduce the L and increase the C via the shortcuts concepts of the SSWN (i.e., SSWCHS).

3.1 Cellular Harmony Search The operation process of the CHS is shown in Fig. 1. The CHS’s main operation process is the same as the HS. However, the CHS’s initial population uses a cellular form such as sub-population (i.e., 3 × 3 matrix as shown in Fig. 1). In this process, new harmony memory in the sub-network is produced and it is compared with the existing population. If the new solution is better than the lowest ranked object, they switch the position. After fitness comparison among grid cells, the object of the highest priority is located in the center of the sub-network. Finally, the centers of the sub-network nodes are compared, and the object of the entire population of the highest priority and the central node are just replaced in the new HM [8].

3.2 Smallest-Small-World Cellular Harmony Search Talking about the SSWCHS, it performs by interactions among the center nodes using shortcuts in the CHS. In the SSWCHS, the center nodes are added in the calculation process as shown in Fig. 2. In this process, the SSWCHS is performed to obtain the final optimal solution through building one more population among best solutions of each sub-population.

Application of New Hybrid Harmony Search Algorithms …

Fig. 1 Processes of the CHS [8]

Fig. 2 Processes of the SSWCHS [8]

249

250

D. Guen Yoo et al.

4 Optimization Results and Discussions There are 9 and 16 integer numbers for magic squares with order 3 and 4, respectively, which have to be selected; hence, the problem search space consists of 99 = 3.9 × 108 and 1616 = 18.4 × 1017 different configurations, considered as difficult solution space for finding a feasible solution satisfying all considered constraints. In light of dimension of search space for considered magic squares, the need of using metaheuristic approaches is understood. As there were not adequate and comprehensive statistical results in literature, we implemented and launched different optimizers for having comparative study. Therefore, the genetic algorithm (GA) [18], the simulated annealing (SA) [19], the particle swarm optimization (PSO) [20], the ant system colony (ASC) [21], and the HS [9] were considered and coded in this research. 100 independent optimization runs were carried out for each test problem in order to have statistically significant results. The MATLAB programming software was used for coding and implementation purposes. The task of optimization was carried out on Pentium IV system 3,400 GHz CPU with 8 GB RAM. In order to have fair comparison with other optimizers, the maximum number of function evaluation (NFEs) (i.e., assumed as stopping condition) is set to 10,000 for all considered orders. Table 1 Obtained optimization results for magic square with orders 3 and 4 using harmony-based algorithms HMS

FSa

Best NFEsb

Average NFEs

Worst NFEs

SDc

No. runs

Max. NFEs

30 81 225 81 225 81 225

87 97 100 100 100 100 100

36 110 287 90 75 90 78

411.49 1,053.13 3,089.22 748.98 1,046.75 722.10 1,129.44

2,035 2,278 6,630 3,582 2,000 3,150 2,054

247.41 344.07 1,101.02 500.96 325.624 409.71 396.78

100 100 100 100 100 100 100

10,000 10,000 10,000 10,000 10,000 10,000 10,000

30 38 667 1,515.78 81 46 2,602 4,394.84 225 1 9,007 9,007 CHS 81 85 909 2,971.69 225 96 2,275 5,348.70 SSWCHS 81 89 1,550 3,985.28 225 96 1,742 5,795.02 a Number of detecting feasible solution b Number of function evaluations c Standard deviation

4,127 8,947 9,007 8,811 9,750 9,690 9,984

8,967.77 1,403.78 0 1,456.67 1,683.59 2,057.17 1,759.23

100 100 100 100 100 100 100

10,000 10,000 10,000 10,000 10,000 10,000 10,000

Method 3×3 HS

CHS SSWCHS 4×4 HS

Application of New Hybrid Harmony Search Algorithms …

251

Table 2 Comparison of statistical optimization results among different optimizers for magic square with order 3 Method

Feasible solution

Best NFEs

Average NFEs

Worst NFEs

SD

No. runs

Max. NFEs

ASC GA PSO SA HS CHS SSWCHS

27 39 84 93 100 100 100

650 160 100 361 287 75 78

5,929.62 678.97 273.81 5,214.44 3,089.22 1,046.75 1,129.44

10,000 8,245 1,100 7,861 6,630 2,000 2,054

2,806.04 1,351.16 195.81 1,463.67 1,101.02 325.624 396.78

100 100 100 100 100 100 100

10,000 10,000 10,000 10,000 10,000 10,000 10,000

Table 1 shows comparison among harmony-based algorithms for two considered magic squares using different harmony memory sizes (HMS). The SSWCHS and CHS have outperformed the HS in terms of statistical results for NFEs and number of detected feasible solution. As can be seen in Table 1, the CHS and SSWCHS have very close competition for 3 by 3 magic square problem. It is worth to mention that these two optimizers are marginally different with each other. Tables 2 and 3 represent the comparison among several metaheuristic methods for magic squares having 3 and 4 orders, respectively. Looking at Table 2, the HS, CHS, and SSWCHS found 100 feasible solutions out of 100 runs, while the CHS is outperformed against other reported methods in terms of statistical results for the NFEs. The ASC has the weakest performance among other reported optimization methods (see Table 2). In Table 3, it can be concluded that only the CHS and SSWCHS have detected more feasible solutions than other methods. The only method which has been competed with the proposed hybrid methods is the HS. However, the HS found feasible solutions in less than 50 % of total number of runs. Similar to the 3 by 3 magic square, the ASC shows the weakest results, while the GA is ranked for the second worst method for finding possible feasible solutions. As it shows, when the

Table 3 Comparison of statistical optimization results among different optimizers for magic square with order 4 Method

Feasible solution

Best NFEs

Average NFEs

0 (17.71) ASC 0 0 (12)a GA 3 765 930 SA 32 5,941 7,931.62 PSO 36 350 2,183.33 HS 46 2,602 4,394.84 CHS 96 2,275 5,348.70 SSWCHS 96 1,742 5,795.02 a Values in parentheses stand for violation

Worst NFEs

SD

No. runs

Max. NFEs

0 (23) 1,150 9,671 9,700 8,947 9,750 9,984

0 (2.57) 198.30 875.27 2,183.30 1,403.78 1,683.59 1,759.23

100 100 100 100 100 100 100

10,000 10,000 10,000 10,000 10,000 10,000 10,000

252

D. Guen Yoo et al.

order of magic square increases, the performance and efficiency of the CHS and SSWCHS are more observed.

5 Conclusions Magic squares have been studied for at least three thousand years. In this paper, magic square problems, classified as combinatorial problems, were tackled using two new hybrid optimization methods, so-called CHS and SSWCHS. The concepts of the CHS are derived based on the CA formation, while the SSWCHS is inspired by adding the topological structure of smallest-small-world network to the CHS. Using comparative study among different harmony-based algorithms and also other optimization methods, the proposed improved methods have shown their superiority over others in terms of number of found feasible solutions. Computational time [i.e., number of function evaluations (NFEs)] proves that the SSWCHS and CHS statistically surpassed other considered optimizers finding feasible solution in less NFEs. In this paper, the CHS and SSWCHS prove their efficiencies for solving magic square problems, while the CHS is slightly outperformed the SSWCHS. Metaheuristic algorithms not only can stochastically construct conventional magic squares of high orders quite efficiently, possibly they also may be applied in constructing some special classes of magic squares with additional properties. Therefore, based on the results obtained from the proposed optimizers, they may be considered as suitable alternatives for efficient solving of magic square problems. Acknowledgments This work was supported by the National Research Foundation of Korean (NRF) grant funded by the Korean government (MSIP) (NRF-2013R1A2A1A01013886).

References 1. Madachy, L.S.: Magic and antimagic squares. Chapter 4 in Madachy’s Mathematical Recreations (1979) 2. Xie, T., Kang, L.: An evolutionary algorithm for magic squares. IEEE, 906–913 (2003) 3. Kraitchik M.: Magic squares. Chapter 7 in Mathematical Recreations, pp. 142–192. Norton, New York (1942) 4. Abe, G.: Unsolved problems on magic squares. Disc. Math. 127, 3–13 (1994) 5. Monfroy, E., Castro, C., Crawford, B.: Using local search for guiding enumeration in constraint solving. In: Euzenat, J., Domingue, J. (eds.) AIMSA. Lecture notes in computer science, vol. 4183, pp. 56–65. Springer, Berlin (2006) 6. Blum, C., Andrea, R.: Metaheuristics in combinatorial optimization: overview and conceptual comparison. ACM Comput. Surv. 35(3), 268–308 (2003) 7. Osman, I.H., Laporte, G.: Metaheuristics: a bibliography. Ann. Oper. Res. 63, 513–623 (1996) 8. Im, S.S., Yoo, D.G., Kim, J.H.: Smallest-small-world cellular harmony search for optimization of unconstrained benchmark problems. J. Appl. Math (2013)

Application of New Hybrid Harmony Search Algorithms …

253

9. Geem, Z.W., Kim, J.H., Loganathan, G.V.: A new heuristic optimization algorithm: harmony search. Simulation 76, 60–68 (2001) 10. Berlekamp, E.R., Convay, 1.H., Guy, R.K.: Winning ways for your mathematical plays, vol.2: Games in particular, pp. 778 783. Academic Press, London, pp. 85 113. Dover, New York 1979 (1982) 11. Pinn, K., Wieczerkowski, C.: Number of magic squares from parallel tempering monte carlo. Int. J. Mod. Phys. C 9, 541–547 (1998) 12. Cadoli, M., Mancini, T., Patrizi. F.: Sat as an effective solving technology for constraint problems. In: Esposito, F., Ras, Z., Malerba, D., Semeraro, G., (eds.) ISMIS, Volume 4203 of Lecture Notes in Computer Science, pp. 540–549. Springer, Berlin (2006) 13. Smith, B. M., Sturdy P.: Value ordering for finding all solutions. In Kaelbling, L.P., Saffiotti, A., (eds.) IJCAI, pp. 311 316. Professional Book Center, Mumbai (2005) 14. Beck, C., Prosser, P., Wallace, R.: Toward understanding variable ordering heuristics for constraint satisfaction problems. In: Fourteenth Irish Artificial Intelligence And Cognitive Science Conference—AICS, 11–16 (2003) 15. Von Neumann, J.: Theory of Self-reproducing Automata. University of Illinois Press, Urbana and London (1966) 16. Wolfram, S.: Statistical mechanics of cellular automata. Rev. Mod. Phys. 55(3), 601–644 (1983) 17. Nishikawa, T., Motter, A.E., Lai, Y.-C., Hoppensteadt, F.C.: Smallest small-world networks. Phys. Rev. E 66, 046139 (2002) 18. Goldberg, D.E.: Genetic algorithms in search, optimization, and machine learning, reading, mass., Addison-Wesley Pub. Co, Reading (1989) 19. Kirkpatrick, S., Gellat, J.R.C.D., Vecchi, M.P.: Optimization by simulated annealing. Science 220, 671–680 (1983) 20. Kennedy, J., Eberhart R.: Particle swarm optimization. In: IEEE IJCNN, Perth, Australia, 4, pp. 1942–1948 (1995) 21. Dorigo, M., Gambardella, J. M: Ant Colony System: a cooperative learning approach to the traveling salesman problem. IEEE Trans. Evol. Comput. 1(1), TR/IRIDIA/1996–5, Université Libre de Bruxelles, Belgium (1997)

Suggest Documents