A two phase hyper-heuristic approach for solving the Eternity II puzzle Wim Vancroonenburg 1 , Tony Wauters 1 , and Greet Vanden Berghe 1 CODeS research group, KaHo Sint-Lieven, Gebroeders Desmetstraat 1, 9000 Gent, Belgium {wim.vancroonenburg,tony.wauters,greet.vandenberghe}@kahosl.be 1 Introduction In this paper we introduce a two phase hyper-heuristic search method for solving the Eternity II puzzle. Eternity II is a challenging money prized edge matching puzzle. Solving the puzzle has been shown to be NP-complete [2]. Hyper-heuristics [1] are a recent trend in heuristic algorithms. They tend to be more general methods than meta-heuristics for solving optimization problems. Hyper-heuristics operate at a higher level of abstraction than meta-heuristics. A hyper-heuristic manages a set of low level, problem specific, heuristics without knowledge of the problem domain, and tries to apply them to the problem in a meaningful way. The two phase hyper-heuristic method introduced here, uses different fitness functions for each phase. 2 Problem description We describe the edge matching puzzle as follows. The puzzle consists of a board with r rows and c columns. Thus, the board has n (= r × c) positions. The board has to be filled with n square tiles. Each tile has one colour for each side. The different colours are numbered from 0 to z. Tiles can be rotated 90, 180 and 270 degrees. The goal is to put all tiles on the board and give them the correct rotation so that the number of matching edges between adjacent tiles is maximized, and that all edges with colour 0 (grey) are on the border (hard constraint). 3 Objectives We studied the effect of using several different optimization objectives. Something similar was done in [4], where multiple objectives were combined into one objective and used as a fitness function for a Genetic Algorithm. We considered the following objective functions: The first objective (Obj 1 ) is the actual objective we want to maximize, i.e. maximizing the number of matching edges. The second objective (Obj 2 ) is to maximize the number of square regions of 2 by 2 tiles that match in their adjacent inner sides. The third objective (Obj 3 ) is to maximize the number of tiles that have their four sides matched with the adjacent tiles. Finally, the fourth objective (Obj 4 ) is to maximize the number of square regions of 3 by 3 tiles that match in their adjacent inner sides. We ran some experiments with these objectives using a hyper-heuristic algorithm (explained in Section 4) for a fixed number of iterations, starting from a random solution. An improving or equal acceptance criterion was used. Several problem sizes were tested(10 × 10, 12 × 12, 14 × 14, 16 × 16). The results revealed that optimizing on Obj 4 results in a higher average number of matching edges. We also noticed that the difference between Obj 1 and Obj 4 becomes larger for larger problem sizes, in favour of Obj 4 . 4 Two phase hyper-heuristic In our approach we use a common hyper-heuristic framework. It consists of an iterative framework with two sub-mechanisms: a heuristic selection mechanism which uses some strategy to select a low level heuristic for generating a new (partial or complete) solution in the current iteration, and an acceptance mechanism to decide on the acceptability of the new solution.