The following tweet has been making the rounds on social media:

If yesterday's Alabama Senate race had been a House election, the Republicans, who got *fewer* votes, would have won 6 out of 7 seats, and the Democrats, who *won* the vote statewide, only 1 out of 7. That's how gerrymandered Alabama is. pic.twitter.com/asGex1KAIC — Leonardo Carella (@leonardocarella) December 13, 2017

Notice that since the Democrats won overall, it would be impossible for Republicans to win all seven districts, no matter how the map was drawn. As such, you might say that Alabama has been gerrymandered as effectively as possible. Sure enough, you can find the usual tell-tale signs of gerrymandering: Some of the district boundaries exhibit strange jagged portions — these portions undoubtedly maneuver to include some parts of the map while avoiding others.

Geometric features of this sort provide a litmus test for geographic compactness (think “shape niceness”). There are several alternatives available: You can consider the length of the district’s perimeter, compare the district’s area to that of its convex hull, compute the district’s moment of inertia about its center of mass, etc. The purpose of these quantifications is to help people systematically flag bizarrely shaped voting districts.

I just posted a paper with Boris Alexeev on the arXiv that shows how you can gerrymander a state into nice looking districts and obtain similarly effective results. As such, geographic compactness alone will sometimes fail to detect substantial partisan gerrymandering. In order to effectively combat partisan gerrymandering, one must apply additional non-geometric features, such as the efficiency gap metric that is currently under consideration by the U.S. Supreme Court.

For the sake of illustration, consider Wisconsin. Currently, Wisconsin has 8 congressional districts with 5 Republican seats and 3 Democratic seats. Next year, we will learn whether these districts were the result of an unconstitutional partisan gerrymander:

(Image from Wikipedia.) What if we were to gerrymander Wisconsin into nice-looking districts? Boris and I pulled election data from the Wisconsin State Legislature Open GIS Data page. Using the results from the 2016 presidential election as a proxy for the spatial distribution of Republicans and Democrats, we drew lines to iteratively split Wisconsin into regions with roughly equal numbers of voters. This is similar in spirit to the shortest splitline algorithm, which was designed to help combat gerrymandering, but we turned it on its head: Instead of blindly selecting the shortest splitline at each iteration, we hunted for splitlines that produced the most gerrymandered map possible. The results were striking:

If we optimize for Republicans, they can win all 8 districts, whereas Democrats can get as many as 7. (It’s impossible to get 8 since Trump won Wisconsin in 2016.)

Minor quibble: The red district in the Democrat-gerrymandered map is not connected, but this apparently isn’t a problem, considering Maryland’s third congressional district.

The bulk of our paper concerns a theoretical guarantee along these lines: Under certain conditions, a party with about 50% of the vote can gerrymander with straight lines to win over 70% of the seats on average. As a teaser, the expected proportion of districts won in our setting is

as the number of voters goes to infinity. Our proof involves interesting manipulations of Brownian motion to compute an exact probability.