cayleypy.bfs_bitmask
- cayleypy.bfs_bitmask(graph: CayleyGraph, max_diameter: int = 1000000) list[int] [source]
Version of BFS storing all vertices explicitly as bitmasks, using 3 bits of memory per state.
See https://www.kaggle.com/code/fedimser/memory-efficient-bfs-on-caley-graphs-3bits-per-vx
- Parameters:
graph – Cayley graph for which to compute growth function.
max_diameter – maximal number of BFS iterations.
- Returns:
Growth function (layer sizes).