Table of Contents
Fetching ...

Approximately Optimal Search on a Higher-dimensional Sliding Puzzle

Nono SC Merleau, Miguel O'Malley, Érika Roldán, Sayan Mukherjee

TL;DR

This work studies the approximately optimal search problem on a high-dimensional cubical sliding puzzle defined by a $d$-dimensional hypercube with a $k$-rule. It evaluates three computational approaches—A$^*$ search (optimal but expensive), reinforcement learning (RL), and an evolutionary algorithm (EA)—to estimate the puzzle's diameter distributions across dimensions $d=3,4,5$ and face dimensions $k\in\{1,\dots,d-1\}$. The results show that A$^*$ solves most small-dimension cases but becomes intractable at higher dimensions, while RL and EA scale better, with RL generally delivering lower move counts at the cost of higher CPU time and EA offering faster solutions with more variability. The work highlights complementary strengths among these methods and suggests avenues for hybrid approaches, with code and data openly available for replication and further study.

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$.

Approximately Optimal Search on a Higher-dimensional Sliding Puzzle

TL;DR

This work studies the approximately optimal search problem on a high-dimensional cubical sliding puzzle defined by a -dimensional hypercube with a -rule. It evaluates three computational approaches—A search (optimal but expensive), reinforcement learning (RL), and an evolutionary algorithm (EA)—to estimate the puzzle's diameter distributions across dimensions and face dimensions . The results show that A solves most small-dimension cases but becomes intractable at higher dimensions, while RL and EA scale better, with RL generally delivering lower move counts at the cost of higher CPU time and EA offering faster solutions with more variability. The work highlights complementary strengths among these methods and suggests avenues for hybrid approaches, with code and data openly available for replication and further study.

Abstract

Higher-dimensional sliding puzzles are constructed on the vertices of a -dimensional hypercube, where 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 rings to pre-defined target vertices on the cube. In this setting, the -rule constraint represents a generalisation of edge collision for the movement of colours between vertices, allowing movement only when a hypercube face of dimension 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 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 . Overall, the EA method consistently requires less computational time, while failing in most cases to minimise the number of moves for the puzzle dimensions and .

Paper Structure

This paper contains 19 sections, 1 theorem, 9 equations, 8 figures, 5 tables, 4 algorithms.

Key Result

Proposition 1

The complexity of A* search on the cubical sliding puzzle with $k$-rule and optimal solution length $n$ is at least $O((2^k-1)^n)$

Figures (8)

  • Figure 1: An illustration of the classical 15-puzzle and the high-dimensional puzzle of dimension $d=3$ for the difficulty level $0$. On the top rows is a classic example of the $15$-puzzle. Starting from configuration (a), the puzzle consists of numbered square tiles which can be slid into a frame using an empty slot. The object uses the space to slide all tiles where they belong (b), the target configuration. The bottom rows show a high-dimensional sliding puzzle of dimension $d=3$. There are $l=4$ uncoloured vertices (i.e., in black) and $4$ coloured vertices with rings of the same colours. On the starting configuration (c), only one ring matches the vertex colour, the purple ring. In contrast, all the ring colours match the vertex colours on the target configuration (d).
  • Figure 2: RL Performances: distributions of the number of moves across different difficulty levels for dimensions $d=3,4$ with different face dimensions $k=\left\{1, \cdots, d-1\right\}$. The number of moves increases with the face dimension and across difficulty levels, with a significant gap between level 4 and the other levels.
  • Figure 3: EA Performances: distribution of the number of moves for different levels of difficulties and with puzzle parameters $k=2$, $d=3$ and $l=4$. The minimum, maximum and median number of moves increases with difficulty. The minimum number of moves for different difficulty levels is $6, 7$, and $10$, with a frequency of $14, 2$, and $3$ out of 150 runs.
  • Figure 4: EA vs. RL number of moves distributions across different difficulty levels for the face dimension $k=2$. (a) For the puzzles of dimension $d=3$, the EA number of move distributions have a wider spread of values, while RL distributions exhibit a more concentrated distribution around the median. (b) For the puzzle of dimension $d=4$, RL's number of moves shows a more peaked distribution, whereas EA's number of moves exhibits a more evenly spread distribution across its range.
  • Figure 5: A* search CPU time plotted against the difficulty levels for different face dimensions. The dot points are different measurements, and the solid lines connect the medians. The A* algorithm consistently requires less computation time for smaller values of $k$ across all levels and puzzle dimensions, demonstrating higher efficiency than high values of $k$.
  • ...and 3 more figures

Theorems & Definitions (5)

  • Definition 1
  • Definition 2
  • Definition 3
  • Proposition 1
  • proof