Fourier Bases for Solving Permutation Puzzles

Horace Pan, Risi KondorAISTATS 2021

Abstract

Traditionally, permutation puzzles such as the Rubik’s Cube were often solved by heuristic search like $A^*\!$-search and value based reinforcement learning methods. Both heuristic search and Q-learning approaches to solving these puzzles can be reduced to learning a heuristic/value function to decide what puzzle move to make at each step. We propose learning a value function using the irreducible representations basis (which we will also call the Fourier basis) of the puzzle’s underlying group. Classical Fourier analysis on real valued functions tells us we can approximate smooth functions with low frequency basis functions. Similarly, smooth functions on finite groups can be represented by the analogous low frequency Fourier basis functions. We demonstrate the effectiveness of learning a value function in the Fourier basis for solving various permutation puzzles and show that it outperforms standard deep learning methods.

Introduction

Solving permutation puzzles—where a set of pieces is rearranged through a sequence of moves—is a classic challenge in AI. Traditionally, these are solved via heuristic search or reinforcement learning (RL). However, standard Deep Value Networks (DVNs) often suffer from poor sample efficiency because they treat puzzle states as "black boxes," ignoring the inherent algebraic structure of the puzzle. Consequently, these networks must "re-learn" the rules of symmetry and permutation from scratch. This paper introduces a method for solving these puzzles by learning value functions in the Fourier basis of the puzzle's underlying symmetry group, providing a powerful inductive bias that makes the learning process faster and more robust.

Methodology: Fourier Analysis on Groups

The core innovation is representing the value function $V(s)$—which estimates the distance from a state to the goal—using Fourier analysis on finite groups. Every permutation puzzle corresponds to a mathematical group. For puzzles like the Rubik's Cube, the authors focus on wreath product groups, which capture both the permutation of pieces and their orientation.

Just as a complex signal can be decomposed into sine and cosine waves, a function on a group can be decomposed into a sum of "irreps" (irreducible representations). These irreps serve as a natural, "low-frequency" basis for smooth functions on the group. The value function is learned as a linear combination of these Fourier features: $V(g) = \sum \text{Tr}[\theta_\rho \rho(g)]$, where $\rho(g)$ is the irrep matrix and $\theta_\rho$ is a learnable coefficient matrix. To maintain parameter efficiency, the authors use low-rank approximations for large irrep matrices.

Table 1: Examples of Young subgroups, their irreducible representations, and the resulting dimensions used in the Fourier basis.

Experimental Evaluation

The approach was evaluated on three puzzles of increasing complexity: the Pyraminx (without tips), the $S_8$ permutation puzzle, and the 2-by-2 Rubik’s Cube. The 2-by-2 Rubik’s Cube is particularly notable for its approximately 3.67 million states and the requirement to model both position and orientation.

Figure 1: Visual representation of states in a 2-by-2 Rubik's cube, highlighting the orientation and permutation challenges addressed by wreath product groups.

Key Results and Insights

  • Extreme Parameter Efficiency: The Fourier models often require two orders of magnitude fewer parameters than DVNs. For the Pyraminx, a Fourier model with ~17k parameters outperformed a DVN with over 1 million parameters.
  • Superior Solving Performance: On the 2-by-2 Rubik's Cube, the Fourier model solved 86.6% of random puzzles using a simple greedy policy, whereas the DVN baseline only managed 11.4%.
  • Sample Efficiency: The Fourier approach reaches high accuracy while seeing a much smaller fraction of the total state space during training. For the 2-by-2 cube, the Fourier model achieved superior results while seeing only 13.2% of the state space, compared to 47.6% for the DVN.

Conclusion and Future Work

By leveraging the algebraic structure of permutation puzzles, Fourier-based value functions provide a highly efficient alternative to standard deep learning methods. While computing irreps for very large groups (like the 3-by-3 Rubik's Cube) is computationally expensive, future work exploring sparsity and automated irrep selection could allow these spectral methods to scale to even larger state spaces.

Summary updated

BibTeX
@inproceedings{pan2021fourier,
  author = {Horace Pan and Risi Kondor},
  title = {{Fourier Bases for Solving Permutation Puzzles}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2021},
  url = {https://openreview.net/forum?id=hBgq3si4dh},
}
Figure