Approximately Optimal Search on a Higher-dimensional Sliding Puzzle

Nono SC Merleau,Miguel O'Malley,Érika Roldán,Sayan Mukherjee
2024-12-03
Abstract:Higher-dimensional sliding puzzles are constructed on the vertices of a $d$-dimensional hypercube, where $2^d-l$ vertices are distinctly coloured. Rings with the same colours are initially set randomly on the vertices of the hypercube. The goal of the puzzle is to move each of the $2^d-l$ rings to pre-defined target vertices on the cube. In this setting, the $k$-rule constraint represents a generalisation of edge collision for the movement of colours between vertices, allowing movement only when a hypercube face of dimension $k$ containing a ring is completely free of other rings. Starting from an initial configuration, what is the minimum number of moves needed to make ring colours match the vertex colours? An algorithm that provides us with such a number is called God's algorithm. When such an algorithm exists, it does not have a polynomial time complexity, at least in the case of the 15-puzzle corresponding to $k=1$ in the cubical puzzle. This paper presents a comprehensive computational study of different scenarios of the higher-dimensional puzzle. A benchmark of three computational techniques, an exact algorithm (the A* search) and two approximately optimal search techniques (an evolutionary algorithm (EA) and reinforcement learning (RL)) is presented in this work. The experiments show that all three methods can successfully solve the puzzle of dimension three for different face dimensions and across various difficulty levels. When the dimension increases, the A* search fails, and RL and EA methods can still provide a generally acceptable solution, i.e. a distribution of a number of moves with a median value of less than $30$. Overall, the EA method consistently requires less computational time, while failing in most cases to minimise the number of moves for the puzzle dimensions $d=4$ and $d=5$.
Artificial Intelligence,Discrete Mathematics,Machine Learning,Neural and Evolutionary Computing
What problem does this paper attempt to address?
The problem that this paper attempts to solve is: in the higher - dimensional sliding puzzle, how to find the minimum number of moves required from the initial configuration to the target configuration. Specifically, the research objective is, under the given k - rule constraint, to determine the minimum number of moves required to move each ring to the predefined target vertex through different computational methods (such as A* search, evolutionary algorithms, and reinforcement learning). ### Problem Background The higher - dimensional sliding puzzle is constructed on the vertices of a d - dimensional hypercube, where \(2^{d - l}\) vertices are given different colors, and the remaining \(l\) vertices are uncolored. In the initial state, these color rings are randomly distributed on the vertices of the hypercube. The goal of the game is to move each ring to its target vertex of the corresponding color. The k - rule constraint means that a move between color rings can be made if and only if a hypercube face with dimension k is completely free of other rings. ### Research Motivation 1. **Theoretical Complexity**: For certain specific cases (such as k = 1 corresponding to the 15 - puzzle), it is known that solving the shortest - path problem is NP - hard. 2. **Practical Applications**: Many engineering and scientific problems can be reduced to the shortest - path problem in graphs. For example, in a game setting, the vertices of the graph represent game configurations, and the edges represent legal move operations. 3. **The Need for Optimization Methods**: Since exact algorithms (such as A* search) have a too - high computational cost in high - dimensional cases, it is necessary to explore approximately optimal search techniques (such as evolutionary algorithms and reinforcement learning). ### Main Contributions 1. **Benchmarking**: A comprehensive benchmark test was carried out on three computational methods (A* search, evolutionary algorithms, and reinforcement learning) to evaluate their performance under different dimensions and difficulty levels. 2. **Algorithm Comparison**: The speed and accuracy of these three methods in solving the higher - dimensional sliding puzzle were compared, and a comparison was also made with the performance of the human - played online version. 3. **Adaptability Analysis**: The adaptability and limitations of different methods in different dimensions were explored. For example, A* search fails in higher dimensions, while evolutionary algorithms and reinforcement learning can still provide acceptable solutions. ### Formula Explanation - **Evaluation Function**: \[ f_{S,T}(C)=g_S(C)+h_T(C) \] where \(g_S(C)\) is the number of moves required to reach configuration \(C\) from the initial configuration \(S\), and \(h_T(C)\) is the lower bound of the minimum number of moves required to reach the target configuration \(T\) from configuration \(C\). - **Heuristic Distance**: \[ h_T(C)=\sum_{i = 0}^{|C|}\left\lceil\frac{|C_i - T_i|}{k}\right\rceil \] This distance represents the shortest number of moves required to reach the target configuration from the current configuration if the k - rule does not prevent any configuration. Through these methods and formulas, the paper aims to provide effective solving strategies for the higher - dimensional sliding puzzle and provide references for the research of similar problems.