maps-more compact and contiguous-than many
human-drawn counterparts. Their work underscored
the capacity of automated methods to expose hidden
suboptimalities in conventional maps and established
a foundation for later algorithmic fairness
benchmarks (Guest et al., 2017).
Building on efficiency metrics, Chatterjee et al.
investigated the computational difficulty of
minimizing the “efficiency gap”-a measure of wasted
votes per side-and demonstrated that although
theoretically NP-hard, practical heuristics could yield
improved maps in states like Pennsylvania and
Wisconsin. Their fast algorithms showed that realistic
efficiency gain is tractable, providing tools both for
legal challenges and neutral map generation
(Chatterjee et al., 2018).
Jacobs and Walch integrated compactness
evaluation with partial differential equations to
generate large ensembles of alternative maps. Their
auction-dynamics and curvature-flow model
generated many plausible districtings, enabling
statistical outlier detection-an essential method for
flagging partisan aberrations (Jacobs and Walch,
2018; Trounstine, 2025).
Turning toward optimization for partisan
advantage, Dugošija et al. formalized a graph-based
integer linear programming (ILP) framework that
enforces population balance, contiguity, and
compactness while optimizing either compactness or
partisan objective functions. Tested on grid and
small-state maps, their ILP models yielded provably
optimal plans, illustrating that granular control is
feasible with academic-grade solvers (Dugošija et al.,
2020; Webb et al., 2025).
Okamoto formulated partisan gerrymandering as
a binary optimization problem akin to ILP-using the
Ising model and simulated annealing. By applying
cell-based redistricting grids to maximize seats for
one party under contiguity constraints, he
demonstrated near-optimal partisan tilting in
synthetic models (Okamoto, 2021).
Most recently, Faure et al. extended linear
programming approaches to optimize political or
minority representation via mixed-integer
programming. Using county-level testbeds, they
approximated probit-based objectives under
contiguity and population constraints, achieving tight
computational bounds, showing that district-scale
partisan optimization is now practical for real-world
scenarios (Faure et al., 2024; Zhu et al., 2021).
Computational geometry and ensemble methods
have become central to the detection of
gerrymandering, offering a means to evaluate enacted
maps against a vast space of algorithmically
generated alternatives. Through techniques such as
Markov Chain Monte Carlo sampling and curvature-
flow modeling, researchers have generated
thousands-sometimes millions-of legally valid
districting plans per state, establishing rigorous
statistical baselines. These methods have been
applied with considerable success in states such as
North Carolina, Wisconsin, and Pennsylvania, where
enacted maps were shown to be extreme outliers
compared to neutral ensembles. On the other hand,
linear and mixed-integer programming approaches
have demonstrated the feasibility of constructing
districting plans optimized for partisan advantage,
under realistic legal and geographic constraints.
These models have been scaled to handle entire
states-such as Indiana, Arizona, and even
Pennsylvania-comprising hundreds to thousands of
precincts or census blocks. In these applications,
solvers have produced maps that outperform existing
gerrymanders in terms of seat maximization for a
target party, while still satisfying population equality,
contiguity, and compactness requirements. In some
cases, the optimized maps yielded partisan
advantages greater than those seen in enacted maps,
underscoring both the potential and the ethical peril
of such mathematical precision (Palomares, 2020).
In this study, the author uses an approach that is
different from past research in a few ways and lift
some of the restraints that are usually required. This
paper aims to see if people can observe any
meaningful or different patterns.
3 METHODOLOGY
3.1 Data Introduction
In this study, the author decides to specifically focus
on the House of Representatives election in
Pennsylvania in 2012-one of the most famous and
controversial occasions where a party used
gerrymandering for its own benefits.
3.2 Method Overview
In this study, the author focuses on the state of
Pennsylvania in 2012, and aims to find the most
optimal way of drawing electoral districts for the
Republican Party using a linear programming model
in python-the author aims to maximize the number of
seats the Republican Party wins in the state. The
author will then compare it to the actual districts in
2012 drawn by a Republican led government which
triggered a lot of controversies as well as a lawsuit