Gerrymandering, an overview

Nothing will produce Bad History more directly nor brutally, than drawing a Line, in particular a Right Line, the very Shape of Contempt, through the midst of a People,– to create thus a Distinction betwixt ‘em,– ‘tis the first stroke.– All else will follow as if predestin’d, unto War and Devastation.
— Mason & Dixon, by Thomas Pynchon

A bit of a doom and gloom quote to start off with, but one that captures a lot of the sentiment around gerrymandering. For those of you who aren't familiar with the subject, gerrymandering is the process by which politicians, tasked with determining the boundaries of electoral districts, draw them in ways that skew the winners of an election, typically favoring whichever party is in power when the maps are redrawn. Here's a good illustration of the idea:

A similar graphic, along with a great explanation of the history of gerrymandering and the complications of drawing good electoral districts is given in this video by Crash Course on YouTube.

Here's another good, if not similar explanation of gerrymandering with more on the typical methods used to build districts with electoral results in mind.

So what does this all have to do with this blog? As I'll go into in more detail, there are a number of ways in which the process of drawing these districts can be turned into an optimization problem and solved computationally instead of by fallible, biased humans. Of course, since humans are also the ones writing the algorithms, there are plenty of ways this bias can creep into the results, which I'll try to show once I get that far into things. The hope though is that, without any ulterior motives, such algorithms can produce Congressional districts that fairly and accurately represent the voting public.

As far as my goals personally for this project, I'd like to present a few promising algorithms that try to solve this problem, show how they work, implement them in code (or demonstrate code from someone who has already done this), and then show how small changes in how we construct the problem can have large, unintended consequences. I suspect that there are a lot of "oh, this is simple if you just..." ideas that don't work as intended, so I look forward to showing, objectively, why that is. As some of my past coworkers used to say, if you don't have data all you have is another opinion.