Will Algorithms Be The New Warriors Against Gerrymandering?

The Define-Combine strategy reduces parties’ ability to pack or crack by giving each party one move.

In the US, Gerrymandering is the process of manipulation where politicians rig the maps and skew the results to favour one political party over another. A long-used process, manipulating district boundaries gives one political party an unfair advantage or dilutes the voting power of minority groups. For instance, in 2010, REDMAP, or Republicans’ Redistricting Majority Project, spent $30 million on down-ballot state legislative races. They also managed to win in Florida, North Carolina, Wisconsin, Michigan, and Ohio. 

These gerrymandering techniques have only become more technologically advanced since 2010, making them tricky to detect in the first place. 


Sign up for your weekly dose of what's up in emerging technology.

New Computational Tools

The redrawing of these maps is one of the most significant factors, bigger than voter fraud or voter suppression laws, in determining how votes get translated and which party gets elected. This has created a need to develop new computational tools to hold politicians to account.

Mathematicians in the US are working on creating and sharpening algorithms that detect and counter gerrymandering. An important factor for them is deciding which maps to choose and interpret the votes within it. This article breaks down some of the most significant algorithms being created by mathematicians from various universities. 

Redist Software at Harvard University

Redist is an open-sourced R software package for redistricting, created by Harvard’s Christopher T. Kenny. Kosuke Imai, a Harvard political scientist, and his research team redefine this software using their Algorithm Assisted Redistricting Methodology (ALARM). This is to make the software user-friendly for citizens to use too.

Redist enables researchers to sample redistricting plans from a pre-specified target distribution. It leverages Sequential Monte Carlo and Markov Chain Monte Carlo algorithms, which allows the package to consider redistribution factors such as geographic compactness and population parity requirements. In addition, the software includes tools for analysis such as summary statistics and plotting functionality. 

Through ALARM, the team researches redistricting sampling algorithms, best practices and workflows for redistricting analysis, and tools to visualize, explore, and understand redistricting plans. Their added features include a new compactness metric, performance improvement, ability to compare and classify plans, newvamped Iowa dataset and function to freeze parts on a district’s map. 

Step by Step: Redist 

Step 1: Defining a redistricting plan using redist_map. 

Step 2: Stimulating plans using one of the algorithm functions: redist_smc, redist_flip, and redist_mergesplit.

Step 3: Using redist’s plotting functions to study the geographic and partisan characteristics of the simulated ensemble.

Define-Combine at Boston University

Created by Maxwell Palmer, a professor at Boston University, and his Harvard colleagues, define-combine is a tool to let algorithms draw.

The tool uses computational thinking to constrain legislators’ hijinks. It works in a two-step process:

  • In the first step, ‘define’, the majority party can draw its maps. But it also has to draw twice as many districts as necessary, dividing the ones it wants into two sub-districts each. The only rule is that the party can’t draw “doughnut” districts that completely encircle other districts.
  • In the second step, ‘combine’, the minority party can combine its subdistricts to create final districts, but only their adjoining districts can be combined. 

Essentially, this allows each party to modify its dream map to minimize the hit it takes from the other party. The Define-Combine strategy reduces parties’ ability to pack or crack by giving each party one move. 

The team illustrated this in a real-life scenario by choosing eight states and mapping their algorithms:

  1. They generated a representative sample, breaking the state into different sub-districts.
  2. They examined ways in which these sub-districts could be paired together.
  3. They identified maps most likely to be chosen by parties and compared those to district maps to find that implementing Define-Combine significantly affected the number of seats each party won in the legislature. 

Multi-Scale Merge-Split Markov Chain at Duke University 

At Duke University, Jonathan Mattingly and his team have written an algorithmic code to prepare for a real-life application of their Multi-Scale Merge-Split Markov chain. 

The Multi-Scale Merge-Split algorithm is used to sample the space of redistricting plans. The chain created is designed to be usable as the proposal in a Markov Chain Monte Carlo (MCMC) algorithm. To sample the space, the researchers will divide the graph into specified partitions where different elements correspond to various districts. In addition, the algorithm created provides scaling properties. It can indicate edges that link to specific districts. “In the current work, we employ a hierarchy of quotient graphs in a multi-scale framework,” the researchers wrote in their paper. “We will demonstrate the possibility for logarithmic, rather than polynomial, complexity which promises to yield samples of redistricting plans fully resolved at the finest levels.”

Mattingly plans on using his algorithms when the Census Bureau releases the 2020 data. The team’s process includes loading up the dataset, running their algorithm to generate a collection of district plans for North Carolina. They will then factor voting patterns into the maps to find benchmarks to access the relative likelihood of election outcomes. 


While different scientists are developing their tools, the baseline method remains the same – a map suspected of being gerrymandered is compared with an extensive collection of unbiased and neutral maps. They implement the technique based on Markov chain Monte Claro Algorithms that provides a class of algorithms for systematic random sampling from high-dimensional probability distributions. These generate a random sample of maps from the universe of possible maps. Based on this, scientists can assume a probability of a given map satisfying policy considerations. 

The ensemble collection of maps are encoded to capture various principles used to draw districts, such as criteria to keep a district compact and connected, making them equal in population, and preserving the communities’ interests. Additionally, it factors in the interaction of these principles with the state’s geopolitical geometry. 

More Great AIM Stories

Avi Gopani
Avi Gopani is a technology journalist that seeks to analyse industry trends and developments from an interdisciplinary perspective at Analytics India Magazine. Her articles chronicle cultural, political and social stories that are curated with a focus on the evolving technologies of artificial intelligence and data analytics.

Our Upcoming Events

Conference, in-person (Bangalore)
Machine Learning Developers Summit (MLDS) 2023
19-20th Jan, 2023

Conference, in-person (Bangalore)
Rising 2023 | Women in Tech Conference
16-17th Mar, 2023

Conference, in-person (Bangalore)
Data Engineering Summit (DES) 2023
27-28th Apr, 2023

Conference, in-person (Bangalore)
MachineCon 2023
23rd Jun, 2023

3 Ways to Join our Community

Discord Server

Stay Connected with a larger ecosystem of data science and ML Professionals

Telegram Channel

Discover special offers, top stories, upcoming events, and more.

Subscribe to our newsletter

Get the latest updates from AIM