Papers
Topics
Authors
Recent
Search
2000 character limit reached

CayleyPy: Python Toolkit for Cayley Graphs

Updated 25 September 2025
  • 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 10310^3 times faster than GAP or Sage. For instance, growth layer computations for S11S_{11} 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 n15n \gg 15 in SnS_n.

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 SnS_n and other groups. Notably, growth statistics often display quasi-polynomial behavior: diameters and distances from the identity are governed by formulas indexed by nmodsn \bmod s for small moduli ss.

Examples include:

  • Diameter formulas for various generator sets (e.g., classical Coxeter generators yielding n(n1)/2n(n-1)/2; cyclic Coxeter variants giving n2/4\left\lfloor n^2/4 \right\rfloor).
  • 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 SnS_n Cayley graphs involving standard and nonstandard generators follow simple or quasi-polynomial forms. For instance:

Generator Family Diameter Formula n mod s Dependence
Coxeter S11S_{11}0 None
Cyclic Coxeter S11S_{11}1 S11S_{11}2
LX (left shift+trans) S11S_{11}3 (odd), S11S_{11}4 S11S_{11}5

A refinement of the Babai-type conjecture is proposed: the undirected diameter of S11S_{11}6 Cayley graphs is upper-bounded by S11S_{11}7, improving over previous S11S_{11}8 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 S11S_{11}9 and conjectured to hold for infinitely many n15n \gg 150.

5. Nilpotent Groups and Diameter Growth

Growth studies in nilpotent groups (notably upper unitriangular matrices n15n \gg 151) indicate diameters scale linearly with n15n \gg 152 given fundamental generators, contrasting with prior polynomial-log bounds [Ellenberg]. For instance:

Group Diameter (undirected) Diameter (directed)
n15n \gg 153 n15n \gg 154 n15n \gg 155

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 (n15n \gg 156 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 n15n \gg 157).

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.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to CayleyPy.