Cayley Graph Analysis for Permutation Puzzles
Overview
Analyzes Cayley graphs of permutation puzzles. Any puzzle whose moves permute a fixed set of positions can be declared as a permutation group, and the same tools then work on it: cycle detection, state space exploration and path search. Two puzzles are built in: TopSpin and Rubik's cubes of any size. The 3x3x3 is solved by four human methods and by a two-phase search after Herbert Kociemba; the 4x4x4 is solved by reduction. The Iterative Cycle Intersection (ICI) method is described in Yuri Baramykov (2026) doi:10.48550/arXiv.2607.13219.
- **
cube_kociemba()** — the 3x3x3 by a two-phase search after Kociemba, so the cube now has five solvers and the first one that searches. Short rather than shortest: phase 1 takes the first way it finds into the subgroup instead of hunting for the one that leaves phase 2 cheapest. - **4x4x4** —
cube_solve4(): reduction (centres, edge pairing) and then a 3x3x3 finish. - **Neural solvers** (needs ggmlR) — train a network to solve the cube without showing it a solution (autodidactic iteration, as in DeepCubeA), save it, and later load it and train it further. The trained network then solves on its own or guides an A* search. The example
inst/examples/train_cube3_q_online.Rtrains a Q-model online and takesinit=to train on from a saved model orresume=to continue an interrupted run from its checkpoint.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-07-11
- OK13 OK2026-06-09
- NOTE12 OK, 1 NOTE2026-06-08
- OK14 OK2026-04-22
Show 2 earlier changesHide 2 earlier changes
- ERROR13 OK, 1 ERROR2026-04-18
- OK14 OK2026-03-10
Documentation
- Help pages
- 180 (19 internal)includes a package overview page
- Examples that run
- 93%112 run in a plain check · 6 only when donttest examples are enabled (R CMD check --as-cran) · 1 never run · 1 hold no code
- Exported functions with examples
- 78%
- Documented parameters
- 97%
- Return-value docs
- 98%
- Help pages citing references
- 1%
Downloads
Repository
Stars over time
Releases over time
Issues over time
Commits over time
6 development-tooling and community-health practices detected across 4 families in the upstream repository
Checks run against github.com/zabis13/cayleyr on 2026-10-21.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Dependencies
Installing cayleyR adds 1 package (1 with compiled code, 1.8 MB of source tarballs). Heaviest: Rcpp 1.8 MB.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 0.3.0Latest2026-10-19 · current release · diff ↗ ··
added 94 exports
cube_adi_astar, cube_adi_load, cube_adi_model, cube_adi_save, cube_adi_solve, cube_adi_train, cube_alg_table, cube_apply_word, cube_at_phase_goal_cpp, cube_build_lslice, cube_central_moves, cube_centre_counts, cube_centre_cycles, cube_centre_positions, cube_centre_shots, cube_centre_structure, cube_colour_state, cube_colours, cube_edge_algs, cube_edge_counts, cube_edge_map, cube_edge_structure, cube_empty_u_slice, cube_expand_alg, cube_expand_move, cube_expand_word, cube_free_moves, cube_group, cube_identity, cube_is_colour_solved and 64 morelisted once in CRAN's queue
Seen in one reading of CRAN's incoming queue, at 2026-10-19 11:41 UTC, so it stayed less than the time between readings. - 0.2.62026-07-29 · diff ↗ ·
added 38 exports
build_permutation_matrix, cayley_bfs_full, cayley_distance, cayley_distance_methods, cayley_graph_diameter, compose_permutation_matrix, convex_hull_3d, create_state_store, cycle_shortcut, enclosing_hull_3d, find_best_match_human, human_algorithm, human_algorithm_to, human_phase1_navigate, human_phase1_rank, landmark_states, openmp_threads, run_length, state_store_indices_for_cycle, state_store_perm_length, state_store_size, state_store_unique_count, store_add_from_df, store_analyze_combos, store_analyze_combos_gpu, store_clear, store_clear_opd, store_collect_ops, store_combos_for_state, store_filter_middle and 8 more - RR 4.6.0 released · 2026-04-24
- 0.2.12026-03-01 · diff ↗ ·
added 33 exports
analyze_top_combinations, apply_operations_batch_gpu, bidirectional_bfs, breakpoint_distance, calculate_angular_distance_z, calculate_differences, calculate_midpoint_z, cayley_gpu_available, cayley_gpu_free, cayley_gpu_init, cayley_gpu_status, check_duplicates, convert_LRX_to_celestial, convert_digits, find_closest_to_coords, find_combination_in_states, find_path_bfs, find_path_iterative, generate_state, generate_unique_states_df, invert_path, manhattan_distance, manhattan_distance_matrix_gpu, reconstruct_bfs_path, reverse_prefix_simple, save_bridge_states, select_unique, shift_left_simple, shift_right_simple, short_path_bfs and 3 more - 0.1.02025-11-25
- RR 4.5.0 released · 2025-04-11
Package metadata
- First published
- 2025-11-25
- Total releases
- 4 / 1 yrs
- License
- MIT + file LICENSE OSI
- Download size
- 959 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("cayleyR")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.