CayleyPy: Python Toolkit for Cayley Graphs
- CayleyPy is an open-source Python library designed for efficient computations on Cayley and Schreier graphs, focusing on large-scale growth, pathfinding, and combinatorial properties of groups.
- It utilizes optimized algorithms, GPU acceleration, and parallelized techniques to outperform traditional systems like GAP and Sage, enabling rapid computation of diameters and growth statistics.
- The toolkit not only benchmarks classical and AI-driven approaches but also generates new mathematical conjectures, enhancing research in combinatorial group theory and extremal graph analysis.
CayleyPy is an open-source Python library engineered for efficient computations on Cayley and Schreier graphs, with particular emphasis on large-scale growth computations, pathfinding, and combinatorial properties of permutation and matrix groups. Recent work using CayleyPy has produced an extensive set of new conjectures concerning diameters and growth statistics for Cayley graphs, identified novel generator families with extremal properties, and established benchmarks for both classical and AI-driven approaches to combinatorial group theory problems. The toolkit distinguishes itself by its speed, scalability, and integration with reinforcement learning and verification-friendly formulations, enabling research activities previously infeasible with standard systems such as GAP or Sage.
1. Algorithmic Capabilities and Performance
CayleyPy supports fast layer-by-layer breadth-first search (BFS) growth, path-finding routines, and computation of diameters for both Cayley and Schreier graphs. Core algorithms are optimized for permutation and matrix group actions and feature highly parallelized operations—efficient hashing, product computation, and bitmask-based BFS variants. The package is GPU-accelerated and can handle large symmetric groups (e.g., S₁₃–S₁₅) or matrix groups beyond the practical limits of traditional systems.
Empirical benchmarks reported that CayleyPy executes growth computations up to times faster than GAP or Sage. For instance, growth layer computations for using Coxeter generators are completed in approximately 22.5 seconds in CayleyPy vs. 884 seconds in GAP. GPU acceleration further enhances runtime, extending feasible computations to in .
2. Generation of New Mathematical Conjectures
Leveraging CayleyPy’s computational power, approximately 200 new conjectures have been observed regarding diameters, growth distributions, antipode characterization, and combinatorial properties of Cayley and Schreier graphs of and other groups. Notably, growth statistics often display quasi-polynomial behavior: diameters and distances from the identity are governed by formulas indexed by for small moduli .
Examples include:
- Diameter formulas for various generator sets (e.g., classical Coxeter generators yielding ; cyclic Coxeter variants giving ).
- Conjectures on "antipodes," i.e., longest elements, their decompositions, and uniqueness.
- Observed distributions for growth statistics (sometimes non-Gaussian or resembling Gumbel distributions).
These conjectures inform theoretical advances and offer new perspectives on open combinatorial group theory problems.
3. Diameter Formulas and the Babai-type Conjecture
CayleyPy's experiments suggest that diameter formulas for Cayley graphs involving standard and nonstandard generators follow simple or quasi-polynomial forms. For instance:
| Generator Family | Diameter Formula | n mod s Dependence |
|---|---|---|
| Coxeter | None | |
| Cyclic Coxeter | ||
| LX (left shift+trans) | (odd), |
A refinement of the Babai-type conjecture is proposed: the undirected diameter of Cayley graphs is upper-bounded by , improving over previous bounds.
4. Generator Families with Extremal Diameters
The project identifies generator configurations ("Editor’s term": square-with-whiskers patterns) that yield Cayley graphs with maximized or nearly maximized diameters. Key families:
- "Sheveleva2": directed LX/LRX cases, alternating adjacents until a square is inserted.
- "Koltsov3involutions": undirected case; three involutions including interleavers and swaps.
For these sets, explicit patterns in generator assignment maximize the diameter, confirmed computationally for and conjectured to hold for infinitely many .
5. Nilpotent Groups and Diameter Growth
Growth studies in nilpotent groups (notably upper unitriangular matrices ) indicate diameters scale linearly with given fundamental generators, contrasting with prior polynomial-log bounds [Ellenberg]. For instance:
| Group | Diameter (undirected) | Diameter (directed) |
|---|---|---|
Growth distributions in such nilpotent cases are observed to follow Gaussian central limit behavior.
6. LLM-Friendly Conjectures and Verification
Some conjectures are designed to be "LLM-friendly," i.e., expressible as sorting problems where decompositions into generators can be verified by Python code or algorithms. This facilitates automated testing using LLMs and enables algorithmic benchmarking via code-based dataset verification.
7. Benchmarking Platforms and Datasets
To support reproducible benchmarking, CayleyPy provides more than a dozen datasets as Kaggle challenges. These specify permutation sets and allowed generators, scoring solutions by total move length. Domains include pancake sorting, reversals, transposons, LX/LRX decompositions, and known puzzles (e.g., Tetraminx, Rubik’s cube). This platform supports comparative experimentation across AI, RL, and classical combinatorial algorithms and assists in LLM benchmarking.
8. Predefined Generator Collections
CayleyPy is equipped with over 100 collections of predefined generators, covering:
- Standard types (neighbor transpositions, Coxeter sets, cyclic Coxeters).
- Shift/transposition variants (LX, LRX, LARX, LSL).
- Families of 3-cycles, prefix cycles, and "down-cycles."
- Generators related to biological rearrangement (reversals, transposons).
- Historic classical sets (Rapaport M1/M2, pancake moves). Such diversity permits immediate experimentation with a wide spectrum of combinatorial group problems.
9. Integration with AI and Reinforcement Learning
Recent extensions include reinforcement learning-based pathfinding pipelines, combining DQN with diffusion distance pretraining for extremely large graphs ( nodes). These AI approaches have been empirically validated against classical GAP-based methods and have established new best results for decomposition problems in symmetric groups (including verification of conjectural diameter formulas in OEIS-A186783 up to ).
10. Impact and Future Directions
CayleyPy’s comprehensive toolkit, extreme computational performance, and scalable design are catalyzing research in combinatorial group theory. Its ability to generate, test, and verify mathematical conjectures at scale—coupled with publicly accessible datasets and algorithmic verification—is advancing both theoretical and algorithmic understanding of Cayley and Schreier graphs. Ongoing development integrates deeper reinforcement learning, group-theoretic library expansion, and further dataset offerings, laying the foundation for renewed investigation and crowdsourced exploration of group dynamics, sorting algorithms, and extremal combinatorics.