AAN ANALYSIS OF IQ LINK R (cid:13) DONNA A. DIETZDEPARTMENT OF MATHEMATICS AND STATISTICSAMERICAN UNIVERSITYWASHINGTON, DC, USA
Abstract.
This is a theoretical and computational strategy exploration of the visually attractive gameIQ-Link. Not all games which are visually appealing are worthy of your time as a puzzlist. This analysisgives a would-be addict some idea of what type of game they are falling for. Introduction
From the moment I first opened my new IQ-Link puzzle (created by Raf Peeters), I felt a very strongattraction to the toy. As Raf says, “It almost seems like the puzzle pieces are jewels or are made of candy...The object of the game is to make all puzzle pieces fit on the game board.” The pieces themselves arecolorful, shiny, translucent, and smooth to the touch. They even resonate with a gently musical percussivesound on their board! The toy is portable and inexpensive, so it makes a great gift.But what is it, really? Should you bother? You get a sense that you’re trying to solve a problemthat has connections to molecular chemistry, but what if you’re just being fooled by its superficial beauty?Perhaps you, like me, feel the Sudoku “strategy” of trial-and-error-until-you-drop is not really strategy atall. According to computer security expert Ben Laurie, “Sudoku is a denial of service attack on humanintellect”[11]. Peter Norvig, in an attempt to cure his wife from this “virus”, wrote an article on his website,“Solving Every Sudoku Puzzle” [11]. His code fits on a single page and can solve the hardest Sudoku puzzlehe could find in only 0.01 seconds. What if IQ-Link is a game of that sort?In the puzzles of yesteryear, puzzles were created by hand and intended to be solved by hand. Now,computers can generate endless “puzzles” for humans, but are they really anything other than clerical speedand accuracy drills? When we, as recreational mathematicians, speak to this point, we can give puzzlists ageneral idea about new games when they come out on the market. This gives a sense of who would like thetoy. In this discussion, I shed light on this complexity question for IQ-Link, a game for which I have foundno theoretical research.Ultimately, the puzzles were all solved algorithmically after several theoretical insights about the puzzlewhich led to algorithmic adjustments. These insights are often the same insights that shed light on how apuzzlist would experience the puzzle. They brought the complexity down to a computable level, but a fewpuzzles still took a great deal of computation time (days). It is my opinion that this toy is well worth thetime spent playing with it, as the puzzlist must continue to develop improvements to their strategies at eachdifficulty level. These are true strategic improvements and not merely the search through more combinations.2.
Background
IQ-Link is a collection of puzzles or one-person games, also called challenges, played on a board with 12pieces. IQ-Link analysis lies in the study of combinatorial game theory. There are no dice or other randomevents or any hidden information in the challenges. Each challenge begins with some of the pieces alreadybeing permanently placed on the board, and the goal is to fit all the remaining pieces onto the board withoutcollisions.In order to place this into its proper context, I will introduce some terminology, but it is not necessaryto read this background section in order to understand the remainder of the talk/paper. There are somevariations in definitions for what consititutes a game, and whether or not a one-player game is a game or not.I prefer less restrictive definitions. By the definitions set forth in Valia Mitsou’s PhD Thesis [10], IQ-Linkwould be classified as a one-player game, or a puzzle. Similarly, there is debate about what constitutes acombinatorial game, but I’m going with the combinatorial game definition in
Winning Ways which states a r X i v : . [ m a t h . HO ] J u l hat for a game to be combinatorial, both players have to know what is going on. “There is completeinformation... There is no occasion for bluffing” [1].Even though there is no randomness in IQ-Link, variations could easily be made to give it randomness oreven turn it into a two-player game. I like the the definition given by Harish Karnick [7] that you can havea player called “Nature” which can introduce random acts. This keeps the definition of combinatorial gameas broad as possible.This talk/paper is partly about theoretical insights, but it reflects mostly on results from running al-gorithms on computers. Perhaps that seems a little bit like cheating. But is it? To get a better idea ofwhat other researchers are doing, and thus what they feel is fair, I want to go back to some ideas in theintroduction of Valia Mitsou’s thesis [10]. She states, “the subject of this thesis is the algorithmic propertiesof one-player games people enjoy playing” and asks, “can we design efficient computer programs that... solveany instance of the puzzle in question?” She’s not the only one asking such questions.Interest in this area has been exploding recently. According to the editors of a January 2015 Dagstahlreport [2], there is a great need for interdisciplinary research alliances in order to advance the boundaries ofour current understanding of both combinatorial games, but also other types of games. Towards this goal,they set up the conference, “Artificial and computational intelligence in games: integration”, with multipleworkgroups. One such workgroup was “Algorithms that learn to play like people,” led by Julian Togelius.This interest by the conference organizers indicates that, it is an active area of research to create algorithmsthat emulate people. This is done partly to classify the difficulty of computer-generated puzzles (such as doneby a team of researchers including Mark van Kreveld [8] and [9]), but also sometimes to create automata toplay against humans. Computers can simulate human dexterity (or reaction time) as well as human strategy[6]. IQ-Link is a game of pure strategy like Chess, Go, or Suduko, and would appear in one corner of AaronIsaksen’s [6] dexterity / strategy classification diagram. It would be in the opposite corner as “Flappy Bird”which is all about dexterity and requires little to no strategy. As I’ve done here, many researchers focusentirely on games of pure strategy. For example, in a 2002 volume of studies edited by Richard Nowakowski,Aviezre Fraenkel [3] and others do this.In Robert Hearn’s 1987 PhD thesis [4] (under the guidance of Erik Demaine and Gerald Sussman), hestates that, “There is a fundamental connection between the notions of game an computation... and indeed...games should be thought of as a valid model of computation, just as Turing machines are.” He goes on tostate that “another curious property of games is that they tend to be as hard as possible given its generalcharacteristics”. This is reassuring to me as it is consistent with my experiences in attempting to create andrefine algorithms to solve IQ-Link.In researching these various papers and talks, I see that many researchers have attacked many games overthe years. In this paper/talk, I share a partial understanding of IQ-Link. I have seen nothing publishedabout this particular game yet, so I feel it’s a reasonable addition to an ongoing series of discussions aboutno-chance games and puzzles in “puzzleland”. 3. Methods
Just because it’s possible to write code to solve a puzzle does not mean it’s easy to solve by hand.Something which is somehow easy on a computer may be hard by hand and possibly vice versa. Whileconstructing an algorithm, it naturally makes sense to keep playing with the puzzle by hand, and to adjustthe algorithm to imitate the by-hand attempts. Of course this process will never fully mimic a human, butthe process has to keep feeding back on itself if we are to use the computer to help predict other puzzlists’reactions to the puzzle.One thing that seemed easy by hand but time consuming to compute was the linking condition on thepieces which will be described in Section 13. This was not initially in my algorithm but was vital to solvingthe more advanced puzzles. The fact that a solution needs to be unique is a big hint when solving by hand.Again, the ultimate goal for me was to find out if the higher levels of this puzzle will continue to be fun forsomeone who doesn’t like Sudoku-like games. This was done by gradually improving the strategy and seeinghow much they improved the search algorithm for the harder puzzles. igure 1.
This is the game board, box, and pieces.
Figure 2.
This is Puzzle 92 and its solution.4.
Toy mechanics
The game (whose manufacturer is found online [12]) is shown in Figure 1 as it appears when a puzzlistbegins to play with it. The puzzle comes with 120 challenges and includes the solution key. One challenageand its solution are shown in Figure 2. Pieces must rest in the raised spots on the board in order for theplacements to be legal. The entire puzzle must be linked to form a connected graph, and the solutions tothe given puzzles are unique. 5.
Puzzle difficulty levels
In the published puzzles (which come with an answer key), there are 24 puzzles each in 5 difficulty levels:Starter, Junior, Expert, Master, and Wizard. This makes 120 puzzles. See Table 1. All puzzles were solvedby algorithms explained in this talk/paper and verified against the published key.6.
A hexagonal model
The interactions of the pieces and legal placements of the pieces on the board suggest a hexagonal tilingmodel. Since this simplification is easier for the computerized analysis, this will be used throughout thearticle. The same puzzle and solution shown in Figure 2 are again shown in Figures 3 and 4 but in hexagonalform. able 1.
Puzzle difficulty levels puzzle level puzzle numbers number of pieces given number of pieces to place
Starter 1-24 9-10 2-3Junior 25-48 5-9 3-7Expert 49-72 4-7 5-8Master 73-96 3-6 6-9Wizard 97-120 2-4 8-10
Figure 3.
A challenge.
Figure 4.
The solution.The pieces can be grouped into families by how many ways they may be legally placed on the board.In the hexagonal diagram of the game board (Figure 5), there are 24 special spots which act as “anchors”(colored yellow). In the actual toy, these are physically raised circles (called “spaces” in the instructions)which will support either a ball on the inside, or a ring on the outside, or both- when the ring is not a fullring. In the instructions, we are told that not all “spaces” must be used in order to achieve a solution. Weare warned, however, that the entire graph of the solution must be linked together. The ball-and-circle jointsare actually vertices in a graph, and the graph is connected in a legal solution.A non-solution with two sub-graphs is shown on the cover of the instruction manual and is included belowin Figure 6. A curve separates the two halves of the puzzle. No pieces on either sub-graph are connected toany pieces on the other sub-graph. (I have never accidentally stumbled upon such a non-solution.)The instruction manual claims that each posed problem has a unique solution. However, there used to bea published errata listing on the official website [5] that indicated that the first version of the toy’s instructionbooklet contained a few puzzles could yield multiple solutions. This was fixed in future editions. This doestell us, however, that it’s possible to pose a solvable puzzle with multiple solutions. Naturally, if you arepresented with an entirely empty board, there are many solutions. able 2.
Puzzle pieces placements and family names diagrams
72 straight light purple144 straight light green aquayellow bluelight pink dark pink152 obtuse dark purpleorange red180 acute dark green dark blueWith those technical disclaimers out of the way, we can presume that the primary goal for a beginnerpuzzlist is to fit the pieces into the grid, and that a secondary check should be done at the end to ensureconnectedness, just in case one should stumble across one of the disconnected non-solutions.7.
Constraints to piece placement
There are 12 unique pieces. Of them, only one has flip symmetry. None have rotational symmetry. Eachof the 12 pieces makes use of at least three “spots”, either by using the inside of the spot or the outside, orboth. (Complete circles effectively trap the inside, so this is modeled as occupation of the inner hexagon aswell as the six outer hexagonal neighbors.)In order to make a reasonable accounting for where the pieces lie, one “ball” or “complete circle” for eachpiece is designated as the anchoring point, although sockets would work also. (It is not important which ballor socket was selected. Of course, once an anchor is chosen, it’s coded that way for all future calculations.)Each legal piece placement is therefore described uniquely by its flip (a binary choice available to all butone piece), its rotation angle (6 possibilities), and its anchor (one of 24 home anchor points). There are,naturally, some illegal placements, because each ball or socket must rest on/in a “spot” on the board. Inmy model, I have an additional piece which is the boundary of the toy’s play area. This way, I can test for igure 5.
The game board with anchor spots.
Figure 6.
A fitted placement which is not a solution.collisions with the boundary to be sure the piece fits on the virtual board in the same way it would on thephysical board. In my diagrams, this boundary piece is black. Illegal placements are simply stopped in thealgorithm by collision mechanisms just like other collisions between pieces.The hexagonal diagram in Figure 5 shows the boundary, the 24 numbered “spots” (or “anchors”) in yellow,and the unreachable locations in black. The toy’s construction hides the fact that there are unreachablelocations in the puzzle. There is no need to account for this separately in the code, as the anchoring processand allowable angles enforce this naturally.As shown in Table 2, each piece has quite a few ways it can legally be placed on an empty board (but notall placements are necessarily strategic). The three straight pieces should each give 144 legal placements.However, due to the mirror symmetry, the light purple piece has only 72 different placements. The fouracute pieces have 180 legal placements, and the five obtuse pieces have 152.Strategic concerns further reduce the options. For example, the light purple piece is shown in Figure 7with its anchor point labeled as “0”. There would be no reason to orient this piece as shown if it were toanchor at spots 0 through 3. To do so would cause its socket to point towards the boundary, rendering itunused. It is fine to leave a socket unused, however, if this piece could be placed this way, it could be flipped,thus violating uniqueness. There are likewise a number of other useless moves which should never be usedfrom the other straight-family game pieces. We also know that sockets of such useful placements must bein use when the placements are part of the solution, in order to guarantee uniqueness. These are tabulatedand filtered out in the code. igure 7.
The only piece with mirror symmetry.
Figure 8.
A useless move.
Figure 9.
A useful move.8.
Orthographic coordinates
To address a position in a hexagonal grid, orthographic coordinates are often used. In a hexagonal grid,there are three families of parallel lines, thus we get “tri-ordinates” rather than “coordinates”. However, sincethe hex grid is in a plane, there is redundancy, and the third coordinate can be dropped computationally,although its use can lead to insights.Similar in nature to Figure 5, Figure 10 shows the game board, but with orthographic coordinates.Horizontal lines have a common first coordinate, and parallel lines which slope upwards have a commonsecond coordinate. The third coordinate is not shown, but it is the sum of the other two. Thus, elementson parallel lines which slope downwards have a common coordinate sum. The cyan elements are the non-reachable locations where were black in Figure 5, and the yellow elements are the spots (or anchors) on thetoy.Consider Figure 11. The point (0,0,0) is labeled as (0,0) and indicates what might be the anchor point ofa puzzle piece. The point (1,3,4) is labeled as (1,3) and indicates a hex cell which is occupied by the puzzlepiece in question. The cell at (1,0) is circled to emphasize that it is upwards and to the right of (0,0). Thecell (1,3) is circled to emphasize that it is three units to the right of (1,0). Thus, any cell can be reached by igure 10.
Game board with orthographic coordinates.using just the two parallel line families P (for positive slope) and H (horizontal movements). The third setof parallel lines is indicated by N (for negative slope). Note again that since P+H=N, any two families maybe used without loss of information.Using (0,0) as the anchor point, the cell currently at (1,3) could end up at (4,-1,3), (3, -4, -1), (-1,-3,-4),(-4, 1,-3), or (-3, 4,1), that is, the underlined coordinates, depending on which legal rotation angle is selected.If the piece is flipped, that cell could end up at (3,1,4), (4, -3, 1), (1, -4, -3), (-3,-1,-4), (-4,3,-1), or (-1,4,3).Each puzzle piece is represented by a set of hex cell elements, each of which is translated by the samemechanism in order to determine the final cells of the game board which are occupied by it. There are12 orientations for 11 pieces, and 6 orientations for the light purple piece. If there is a collision with theboundary, this is clearly an illegal placement. Likewise, if a piece will collide with another piece, it may notbe placed at the desired anchor with the desired orientation.9. “All Legal” strategy
The first strategy one would probably consider is to simply try each available piece in every plausiblespot. Thus, the first thing tabulated by the algorithm is every placement that is legal for every piece, atthe start of play. For the first four “Starter” level puzzles, (in fact 7 of the first 11 puzzles) this alone yieldsthe solution. That is to say, as soon as you find that a piece fits into an open spot, it’s in the correct finallocation for that piece. This is where the puzzle starts to slowly ramp up in difficulty, as it builds confidencein the puzzlist. However, it is also a great way to introduce kids and non-mathematician friends to a veryfun puzzle.The next thing a puzzlist might notice is that some (but certainly not all) pieces may have exactly onelegal placement. Surely if this is the case for any piece, the solution must contain that placement. The otherpieces’ options are now reduced. This process iterates. This basic process of elimination will solve 21 of thepuzzles. Most of these are in the “Starter” level, but one is even in the “Expert” level!10.
Pairwise cleanup
To extend the process of elimination a bit, certain additional placements are eliminated. For each piece,there is a collection of possible legal placements upon starting the puzzle. Consider one individual pieceplacement for a red piece, and another entire collection of placements for a green piece: If that one placement igure 11.
How to flip and rotate in orthographic coordinates.cannot be used with any of the placements for the second piece, clearly that placement cannot be used. Bythis logic, quite a few placements are eliminated. This strategy alone solves all but one of the first 25 puzzlesand a total of 29 puzzles overall.As an example, let’s take a puzzle which has six remaining legal placements, two for each of three pieces.Vertices in Figure 12 indicate legal placements, and they are colored to indicate which piece they refer to.Edges represent compatible (non-intersecting) placement pairs. Notice that placement 3 is not compatiblewith any of the placements for the green piece, so placement 3 can’t be used. Once placement 3 is removedfrom the graph, it is obvious that placement 4 must be in use, because it is the only remaining placementfor the red piece. Similarly, placement 6 does not connect to any green placements, so it is discarded.11.
The effects of basic cleanup techniques
After tabulating the available legal piece placements, basic pairwise cleanup and a few other easy taskscan dramatically reduce the search space. These other basic tasks are: elimination the duplication from thesymmetry of the light purple piece, and getting rid of the “unwise” placements. Figure 13 compares beforeand after for the count of permitted piece placements, graphed on a log scale.Even expressed on a log scale, the reduction in possible moves does not look very impressive, and it’seven less exciting without the log scale. However, when expressed as total combinations of piece placements(Figure 14) rather than just the number of piece placements options, and when the results are expressed as igure 12.
Basic pairwise cleanup.
Figure 13.
Size of search space before and after basic cleanup (logscale).
Figure 14.
Reduction of search space by percent.a percent rather than raw values, it’s clear that there is quite a bit of value in doing even this little bit ofcleanup. For the easiest problems, it seems to help quite a bit, but less so for puzzles after about number60. igure 15.
The edges are not as easily occupied as the center of the board.
Figure 16.
Puzzle 25, its solution, and its heatmap.12.
Heatsort
Since a naive way to brute force a solution is to simply try all possible permutations of legal placementsfor each piece, it would make sense to try to prioritize the list somehow. One way this can be done is tosuperimpose all the possible legal placements onto a single grid and see which locations on the base gridare harder to reach. Although it’s true that not all spots must be covered, it is reasonable, for example, toprioritize trying “the one piece that can go there” before trying to leave a position empty. That being said,this is something of an Achilles’ Heel for this algorithm.The heatmap in Figure 15 reflects the superposition of all possible legal moves, with red indicating a morereachable place and blue indicating a harder to reach place. For four puzzles (Figures 16, 17, 18, and 19),the puzzle, the solution with the puzzle grayed out, and the heatmap are shown.Heatmap 25 is all one color, because every element of this heatmap has the value 1. Each piece has exactlyone legal placement, and hence the puzzle is trivial.The heatmap for Puzzle 29 has mostly purple elements, but the bits of red indicate elements which canbe covered by more than one puzzle piece. igure 17.
Puzzle 29, its solution, and its heatmap.
Figure 18.
Puzzle 40, its solution, and its heatmap.In Puzzle 40, the heatmap is still giving very clear directives for us to place a couple of pieces with priority.For example, the light purple piece must be placed at the top of the puzzle. However, for Puzzle 85, you seemore color variations, and the heatmap looks more like the overall heatmap for the entire puzzle. Thus, the igure 19.
Puzzle 85, its solution, and its heatmap.algorithm will first try something such as placing the correct light purple, light pink, and aqua pieces downand then continue to look for the solution to the remaining puzzle with 6 missing pieces.The benefits of adding heatmap sorting to our basic introductory phase of the sorting can be shown inFigure 20. Since a solution method (Section 13) was eventually successful in finding all 120 puzzle solutions,it was possible to compute how many puzzle combinations would have had to have been tested from a givensorted order of legal piece placements, in order to reach the solution. The number of combinations (as shown)grows with increasing polynomial complexity, so this graphic can be misleading. Still, it is interesting to seewhat fraction of the combinations are washed out by the various techniques.For the simpler puzzles, not only is there less benefit to doing any sorting, there simply aren’t manycombinations to begin with. For example, in Puzzle 6, the 3rd of 15 combinations to be tested will be foundto work. After basic reductions, only one viable combination remains. For Puzzle 19, the puzzle would beinitially solved after 178 of 1232 combinations. That drops to the 12th combination after basic reductionsand heat sort. Puzzle 119, however, starts out with around 7 × combinations and has to search throughabout 5 × of them before reaching the solution. After cleaning up and heat sort, this drops to 2 × .What a bargain! Puzzle 120 appears to be fairly “easy” with only 6 × combinations, dropping to a mere2 × . So the fraction of search space to be explored does not say much about computability.13. Search space restriction by linkage requirement
Even with the reductions discussed, and even after using a heatsort, the search space is still enormous.But the addition of linkage requirements to the algorithm ended up making the difference in computability.If not for this requirement being added, there might still be computers running! Recall that the number ofpieces to be placed keeps growing throughout the puzzle levels, although not monotonically. To solve a puzzlewith n missing pieces is therefore O ( n !) (which is consistent with [4] p.13) for a naive search mechanism,even after using clever sorting tricks. Let me pause to make a disclaimer about the order of this puzzleand then retract it. Since the maximal number of missing pieces is 12, one can argue that this puzzle isnever higher than O ( n ) and cannot rightfully claim its place in the elite community of factorial problems.However, while this is true, it is clear to me that this puzzle was capped at precisely that point at which thefactorial growth starts to kick in computationally, making it indeed a part of the discussion. igure 20. Fraction of search space explored, reduced by basic techniques, then by heatsort.
Figure 21.
Pieces to place, graphed by puzzle number.To reduce this horrific computational explosion, a wiser strategy (and more compatible with what a humanpuzzlist would do) would be to restrict each successive piece placement to a piece which would actually linkto one of the existing pieces already in the puzzle. This makes sense because a puzzle can be completed byonly selecting from the available, currently-linkable pieces.Please recall the connected graph structure requirement from the puzzle’s instructions in Section 4. Thesolution has to be a connected graph, so the solution itself can be thought of as its own spanning tree. Loopsare certainly permitted but never required, and they do not impede the analysis in any way.As a specific example, consider the puzzle in Figure 23 (previously also shown in Figure 2). The lightpurple piece can be anchored immediately at spot 2 as shown in gray in Figure 23, and it’s part of the solution.Another placement, which is also part of the solution and is also grayed out, cannot yet be anchored to itshome at spot 17, because it is not currently linkable.While this reduces the search space, it makes for a more complex process. Consider the first piece to beplaced in any puzzle, especially a harder one. There will be many available placements, and all placements inthe final solution are immediately available for you to select. However, if you force each successive placementto be a linked placement, this dramatically reduces the number of pieces you may place at any given moment, igure 22.
Relationship between all legal placements, correct placements, and currentlylinkable pieces.
Figure 23.
Two grayed out solution pieces for Puzzle 92, one of which is currently linkable.however, if you are already on the right track, you are promised at least one fruitful placement is availableto you to make. This makes an apples-to-oranges comparison difficult, but it has to be done nonetheless.Figure 24 indicates how many placements are available at the start of each puzzle. Note that for harderpuzzles, this can be over 800.Figure 24 also shows the number of original placements which are also linkable to the original puzzle. Thehighest values are around 80. For the easy puzzles, all available placements are linked.This focus on only linkable placements actually reduces the problem dramatically, to the point where itis finally computable. If linkage conditions are not used, the problem quickly explodes. This effort is notwithout cost, and for easier puzzles, it is not worth the time computationally. The transition, however, israther brutal. (Computed on FUJITSU T734 laptop.)To give an idea of the pruning that happens at runtime, consider Puzzle 29. As the algorithm searchesfor possible moves, at one point it finds 23 legal placements, only 5 of which satisfy the linkability criterion.At some other point, it finds 20 legal placements, 4 of which satisfy it. This is shown in Table 4. To give anidea of what happens to a random sample of puzzles of various difficulties, this table gives a partial listingof some of the decision reductions made at various steps by the algorithm.For the puzzles selected here, the reductions range roughly between 80% and 99%, and the solution timeswere quite fast, with Puzzle 80 taking about 24 seconds and Puzzle 90 taking about 2 minutes.Figure 24 shows the number of first moves available, per puzzle, in light blue, and it shows the number oflinkable first moves available in dark blue. For the easier problems, all moves are linkable and are shown inlight green. However, for the most difficult problems, there is a huge differential, going from numbers closeto 900 down to numbers closer to 80. igure 24.
Total number of legal and linkable moves at the start of each challenge.
Table 3.
Comparision of runtimes for two methods for a few select puzzles running on aFUJITSU T734. puzzle missing pieces search without linkability search with linkability
47 7 (gave up!) 2.5 seconds48 6 0.001 seconds 1.5 seconds49 5 2 seconds 1.5 seconds50 5 0.001 seconds 0.7 seconds51 5 0.02 seconds 0.8 seconds52 6 0.001 seconds 1.3 seconds53 7 170 seconds 2.7 seconds
Table 4.
Reduction ratios for linkability criteria for selected puzzles.puzzle number of missing pieces ratios on search branches29 5 5/23 4/2038 4 4/4160 6 22/129 19/95 11/4780 8 25/407 16/324 13/267 7/9890 8 5/550 5/442 11/359 7/79 3/33 5/85.....14.
Transition between the two methods
The algorithm finally used to solve the puzzles was basically recursive with various guiding strategies,including heatsort (Section 12) and use of linkability (Section 13), but when it gets down to either 3 or 4remaining pieces, it searches exhaustively. The transition to exhaustive search can be set to any level, butexperience shows that 3 or 4 remaining pieces is the best transition point, and it doesn’t matter too muchwhich of those is selected. Recall Table 3 where it is demonstrated that this transition between the two basicstrategies is rather abrupt. The reader may wonder why 5 or 6 is not used as the transition level, because ofthe values in Table 3, but in the table, we were only looking for known solutions, which can be found muchmore quickly than exhastively searching an entire space of solutions to verify that none exist in any branch.For example, we were very lucky in Puzzle 53 to reach the solution to a Puzzle with 7 missing pieces in only170 seconds. We were able to do this only because the first guess was correct due to heatsort and thus thesolution was found quickly. This was not the case, for example, for Puzzle 47. igure 25.
Computation time per challenge, in seconds.
Figure 26.
Computation time per challenge, with logscale.The two graphs in Figures 25 and 26 give computation time in seconds, and the log-seconds for transi-tioning to exhaustive search at either 3 or 4 remaining pieces in a puzzle. All puzzles were ultimately solved.(There can only be a solution or a hung computer. We are guaranteed to eventually find the solution.) Thelongest puzzle took about 5 1/2 to 7 days to solve on an Intel core i7 - 3820 8-core processor running at3.6 GHz with 32 GB of RAM, depending on which transitioning strategy was used. Notice that the spikeswhich look really curious Figure 25 are hardly even noticeable in Figure 26, due to the factorial nature ofthe growth of move options in the game.15.
Counting balls and sockets
One thing that I found myself tracking by hand was the amount of physical space available in the puzzle.Spots may be left empty according to the instructions. But how many can we leave empty? Recall that theboard contains 24 spots.Of the 12 pieces, there are these broad categories: “2 Balls and a Socket”, “1 Ball and 2 Sockets”, “2Sockets and a full Circle”, and “1 Ball, 1 full Circle, 1 Socket”. If you could break up those pieces, you wouldget 16 Balls, 14 Sockets, and 6 Circles. Circles take up the anchoring spot as well as the 6 hexagonal spotswhich surround the anchor. Most balls can mate with most sockets, but there are a couple of exceptionswhich I can safely ignore for this analysis. (The dark green and dark blue acute pieces each have an “elbow”style ball. These can only fit into the light purple socket.)herefore, we can use the 24 spots in just one of the following three ways: 2 unmatched balls, 14 ball/socketsets, and 2 empty spots 3 unmatched balls, 1 unmatched socket, 13 ball/socket sets, and 1 empty spot 4unmatched balls, 2 unmatched sockets, 12 ball/socket sets, and no empty spots.A more robust algorithm can look for permanent isolations of this sort, and once the maximum numberof unmatched balls or empty sockets is reached, no more should be permitted, causing a return to theprevious recursion level. Balls and sockets were determined to be permanently unmatched when the heatmap indicated that no remaining pieces could be placed with them.It’s harder to make a general statement about this part of the algorithm, because I only did a few side-by-side timed comparisions. In a similar pattern to what we saw in Section 11, the harder the puzzle, the moretime is saved by doing this analysis. For easier problems, the time sunk to do the calculations is essentiallywasted. To give a few examples, Puzzle 75 took 53 seconds on the FUJITSU T734, down from 66 secondswithout testing for unreachable balls and sockets. Puzzle 80 took 24 seconds either way. However, Puzzle 82went from 813 seconds without the test down to 492 seconds with them. For all these cases, the transitionto brute force was made when there were 3 pieces remaining.16.
Other insights
Many of the smaller details of the algorithm have been left to the reader’s imagination, but there are afew insights worthy of sharing. Once you calculate the set of legal piece placements for a puzzle (which isactually pretty fast), the original puzzle as well as the boundary may be disposed of. Since all collisionswith the original puzzle and the boundary are not longer possible, the only collisions must be betweensolution pieces. This cuts down the computational complexity. This insight has logical implications, such as“well let’s just tabulate all possible collections of 3 or 4 or 5 pieces!” So far, this instinct and many otherpresumably mathematically correct insights have led to many failed solution computation attempts, becauseof computational complexities that are not immediately obvious. There is always hope that there is yetanother mathematical insight that can be made that will further reduce the computational complexity ofthese searches. 17.
Insights not incorporated in the algorithm
One possible improvement to the algorithm would be to attempt to implement what seems obvious to ahuman puzzlist but might be difficult for a computer. Sometimes, the puzzle appears to have an obvioussplit, or is highly likely to have a split, which causes the puzzle to appear as two (or perhaps more) separatepuzzles sharing the same pool of pieces. For a human, this adds information, but in terms of coding, I havereally no idea how to put that part of my intuition into the algorithm.There are certainly many more improvements which could be made to the algorithm, but the primaryobjective was to generate advice for the would-be addict of this puzzle. Towards that end, I feel I’ve gatheredenough evidence to support my conclusion. 18.
Conclusion
Even after having “solved” all 120 puzzles using a combination of search-space reductions and brute force,I still find myself in awe of the puzzle. For me, I can conclude that it is a wholesome toy that encourageslogical thinking, because the puzzlists must continue to update their strategies as they advance through thestages in order to complete the challenges. A human cannot solve the puzzle simply by trying all possiblecombinations, except for at the very earliest stages. Since the puzzle is inexpensive and aesthetically pleasing,I encourage would-be puzzlists to go ahead and give it a try!
References [1] Elwyn R Berlenkamp, John Conway, and Richard Guy,
Winning ways for your mathematical plays: Volume 1 . AK Peters,2001.[2] Dagstahl Reports,
Artifical and computational intelligence in games: integration . Vol. 5, Issue 1, pp 207-242. Editors: SimonLucas, Michael Mateas, Mike Preuss, Pieter Spronck, and Julian Togelius, January 2015.[3] Aviezre Fraenkel,
Bibliography of Combinatorial Games: Updated . pp 475-535 in MSRI publications Volume 42, 2002.
Moregames of no chance , editor Richard Nowakowski.[4] Robert A. Hearn,
Games, puzzles, and computation . PhD Thesis, Massachusetts Institute of Technology, 1987.[5] Internet Archive. erratanotice published between 2014 and 2018.6] Aaron Isaksen, Drew Wallace, Adam Finkelstein, and Andy Nealen,
Simulating strategy and dexterity for puzzle games .IEEE Conference on Computational Intelligence and Games, August 2017.[7] Harish Karnick,
Basics of game theory 1
Automated Puzzle Difficulty Estimation . In 2015 IEEE Conference onComputational Intelligence and Games.[9] Mark van Kreveld, Maarten L¨offler, Nicky Vendrig, and Paul Muster,
Puzzle Complexity
The computational complexity of some games and puzzles with theoretical applications . PhD Thesis, CityUniversity of New York, 2014.[11] Peter Norvig,
Solving every Sudoku puzzle . http://norvig.com/sudoku.html, June 2006.[12] Website of IQ-Link manufacturer smartgamesandpuzzles.com , 2019.
E-mail address ::