CayleyPy API Reference

Core classes and functions

cayleypy.CayleyGraphDef(generators_type, ...)

Mathematical definition of a CayleyGraph.

cayleypy.CayleyGraph(definition, *[, ...])

Represents a Schreier coset graph for some group.

cayleypy.CayleyPath(start_state, edges, graph)

Path in a Cayley graph.

cayleypy.find_path(graph, start_state, **kwargs)

Finds path from start_state to central state.

Graphs library

cayleypy.PermutationGroups()

Pre-defined Cayley graphs for permutation groups (S_n).

cayleypy.MatrixGroups()

Pre-defined Cayley graphs for matrix groups.

cayleypy.Puzzles()

Definitions of graphs describing various puzzles.

cayleypy.GapPuzzles()

Library of puzzles defined in GAP format.

cayleypy.create_graph(*[, ...])

Creates CayleyGraph.

cayleypy.prepare_graph(name[, n])

Returns pre-defined CayleyGraphDef by codename and additional kwargs.

Beam search and ML

cayleypy.Predictor(graph, models_or_heuristics)

Estimates distance from central state to given states.

cayleypy.algo.BeamSearchAlgorithm(graph)

Beam search algorithm for finding paths in Cayley graphs.

cayleypy.algo.BeamSearchResult(path_found, ...)

Result of running beam search on a Cayley graph.

cayleypy.algo.RandomWalksGenerator(graph)

Generator for random walks on Cayley graphs.

cayleypy.models.ModelConfig(model_type, ...)

Configuration used to describe ML model.

BFS algorithm and its variations

cayleypy.algo.BfsAlgorithm()

Basic version of the bread-first search (BFS) algorithm.

cayleypy.algo.BfsResult(bfs_completed, ...)

Result of running breadth-first search on a Schreier coset graph.

cayleypy.algo.bfs_bitmask(graph[, max_diameter])

Version of BFS storing all vertices explicitly as bitmasks, using 3 bits of memory per state.

cayleypy.algo.bfs_numpy(graph[, max_diameter])

Simple version of BFS (from destination_state) using numpy, optimized for memory usage.

cayleypy.algo.InteractiveBfs(graph, start_states)

Interactive breadth-first search that computes layers one by one.

cayleypy.algo.MeetInTheMiddle()

Meet-in-the middle (MITM) algorithm for path finding.