Quantifying Gerrymandering Project Documentation
This site gives introductions to some of the tools developed by the Duke Quantifying Gerrymandering group. The group, headed by Jonathan C. Mattingly and Gregory J. Herschlag, works to understand how to assess the degree to which political districts capture the will of the people in the elections in which they are used. The group has benefited from collaboration countless colleagues and students. For more information, please see the groups blog.
A few tools of possible particular interest are:
- Cycle Walk: A Julia implementation of a promising algorithm to sample an ensemble of redistricting maps from a specified measure on the space of all redistrictings. The algorithm is described in (D. R. DeFord et al., 2025). (GitHub repo)
- Metropolized Forest Recom: An algorithm that modifies the original Recom algorithm (D. DeFord et al., 2021) so that it can better sample from a specified probability distribution and so that it can better preserve geographical structure like counties. (See E. Autry et al., 2023) (GitHub repo)
- Metropolized Multi-scale Forest Recom: An algorithm that further modifies Metropolized Forest RECOM so that it runs on a multiscale graph. One advantage is that it can better preserve geographical structure like counties. (See E. A. Autry et al., 2021) (GitHub repo)
- Atlas File Format: The format used by the Quantifying Gerrymandering Project’s software to efficiently store and document a collection of maps. The AtlasIO packages in Julia and Python can be used to read and process the files. (GitHub repo)
References
Autry, E. A., Carter, D., Herschlag, G. J., Hunter, Z., & Mattingly, J. C. (2021). Metropolized multiscale forest recombination for redistricting. Multiscale Modeling & Simulation, 19(4), 1885–1914. https://epubs.siam.org/doi/10.1137/21M1406854
Autry, E., Carter, D., Herschlag, G. J., Hunter, Z., & Mattingly, J. C. (2023). Metropolized forest recombination for monte carlo sampling of graph partitions. SIAM Journal on Applied Mathematics, 83(4), 1366–1391. https://epubs.siam.org/doi/10.1137/21M1418010
DeFord, D. R., Herschlag, G., & Mattingly, J. C. (2025). A cycle walk for sampling measures on spanning forests for redistricting. https://arxiv.org/abs/2509.08629
DeFord, D., Duchin, M., & Solomon, J. (2021). Recombination: A family of markov chains for redistricting. Harvard Data Science Review, 3(1). https://hdsr.mitpress.mit.edu/pub/1ds8ptxu/release/5