chipfiring - A Python Package for Efficient Mathematical Analysis of Chip-Firing Games on Graphs
Jun 30, 2025·
,,·
0 min read

Dhyey Mavani
Dr. Nathan Pflueger
Tairan (Ryan) Ji

Abstract
“chipfiring” is an open-source Python package that implements the full
mathematical machinery of chip-firing (a.k.a. the dollar game or sandpile
model) on finite, undirected multigraphs. It provides object-oriented data
structures for graphs and divisors, fast implementations of Dhar’s burning
algorithm, linear-equivalence and q-reduction routines, divisor-rank
computations connected to the Riemann–Roch theorem, and optional interactive
visualisation via Dash. Benchmarks show polynomial-time winnability checks on
graphs with hundreds of vertices and edges, filling a long-standing gap in the
Python scientific-computing ecosystem for chip-firing research and education.
Type
Publication
arXiv preprint (arXiv:2505.01234)