CayleyR package uses cycle intersection and GPU to solve TopSpin puzzles
New R package cracks permutation puzzles 10x faster using bidirectional search and Vulkan.
Researcher Yuri Baramykov has introduced CayleyR, an R package designed to solve permutation puzzles by leveraging cycle intersections within Cayley graphs. The package specifically targets the TopSpin(n,k) puzzle, a sliding tile challenge with a state space modeled as a Cayley graph of the symmetric group Sn. The core algorithm employs an iterative bidirectional search: starting from both the initial and target permutations, it generates random operation sequences that form cycles in the graph. The intersection of these cycles yields a connecting path, effectively solving the puzzle. If no direct intersection is found, a distance-guided bridge selection step narrows the gap, and the process repeats until a solution is discovered.
What sets CayleyR apart is its performance-oriented implementation. The package combines a C++ hash-indexed state store for fast lookups with optional Vulkan GPU acceleration, allowing it to handle large state spaces efficiently. The mathematical framework relies on fundamental group theory and graph theory concepts, making the algorithm adaptable to other permutation puzzles beyond TopSpin. The package is publicly available on CRAN, complete with documentation and examples. For AI researchers and puzzle enthusiasts, CayleyR represents a novel approach to combinatorial search problems, blending classical algorithms with modern hardware acceleration.
- CayleyR uses iterative bidirectional search with cycle intersection in Cayley graphs to solve TopSpin puzzles.
- Implementation combines C++ hash-indexed storage with optional Vulkan GPU acceleration for speed.
- Available now on CRAN; algorithm is adaptable to other permutation puzzles beyond TopSpin.
Why It Matters
Brings advanced group theory and GPU acceleration to combinatorial search, enabling faster solutions for permutation puzzles.