Skip to content

mggg/TDA-redistricting

Repository files navigation

Persistence of Gerrymandering example code

This is some of the code used for the paper "The (Homological) Persistence of Gerrymandering" by Duchin, Needham and Weighill.

  • tdaredistricting.py: the main functions needed to convert districting plans into persistence diagrams.
  • generate_ensemble.py: an example script for generating an ensemble of Congressional plans for Pennsylvania.
  • make_graphics.ipynb: a jupyter notebook for generating some plots from the output of generate_ensemble.py.

All of the code requires the open-source ensemble generation code GerryChain and the gudhi library. The PA shapefile is from the mggg-states github.

About

Applying persistent homology to redistricting

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published