Inspiration

There are a ton of supreme court cases going on right now in a number of states about this issue and being able to solve this in a non-bias, non-partisan way will help the whole country. When we saw that esri was here we decided to give it a shot.

What it does

It loads in shapefile data showing the VTDs(voting tabulation districts) of a given state, then plots colors randomly across those VTDs the total number of colors equaling the number of Congressional Districts that those VTDs make up. Once those are assigned, we grab the entire area and perimeter of all the VTDs in a given district and calculate its polsby-popper score (a geometric measure for detecting if gerrymandering might have occurred within a state). We then implemented a MCMC metropolis hastings algorithm in which we take a random VTD, and change its classification to another district and then run the polsby-popper scores again and see if it got better or worse. If it gets better we keep it, if it gets worse we throw it out, and we continue this until the map starts to converge to a "fair" state.

How we built it

We used a node.js backend with express.js, leaflet, and bootstrap. We deployed on AWS.

Challenges we ran into

We had a couple of false starts where we had to scrap the front end development because of back-end restrictions. We also ran into trouble using the arcgis API as we were unfamiliar with it.

Accomplishments that we're proud of

The visual representation of how the data is being manipulated to converge to a better state. Also drawing all the polygons and visual data from scratch. Plus starting, finishing, and submitting an application in less than 24 hours.

What we learned

Communicate better when making changes that may have affects on someone else part of the project. Also working in an agile environment.

What's next for Fantastic MCMC

Get more measures for measuring "fairness" and optimize the step through.

Share this project:
×

Updates