On theoretical and empirical algorithmic analysis of the efficiency gap measure in partisan gerrymandering

Partisan gerrymandering is a major cause for voter disenfranchisement in United States. However, convincing US courts to adopt specific measures to quantify gerrymandering has been of limited success to date. Recently, Stephanopoulos and McGhee in several papers introduced a new measure of partisan gerrymandering via the so-called “efficiency gap” that computes the absolute difference of wasted votes between two political parties in a two-party system; from a legal point of view the measure was found legally convincing in a US appeals court in a case that claims that the legislative map of the state of Wisconsin was gerrymandered. The goal of this article is to formalize and provide theoretical and empirical algorithmic analyses of the computational problem of minimizing this measure. To this effect, we show the following: (a) On the theoretical side, we formalize the corresponding minimization problem and provide non-trivial mathematical and computational complexity properties of the problem of minimizing the efficiency gap measure. Specifically, we prove the following results for the formalized minimization problem: (i) We show that the efficiency gap measure attains only a finite discrete set of rational values. (observations of similar nature but using different arguments were also made independently by Cho and Wendy (Univ Pa Law Rev 166(1), Article 2, 2017). (ii) We show that, assuming P $$\ne \textsf {NP}$$ , for general maps and arbitrary numeric electoral data the minimization problem does not admit any polynomial time algorithm with finite approximation ratio. Moreover, we show that the problem still remains $$\textsf {NP}$$ -complete even if the numeric electoral data is linear in the number of districts, provided the map is provided in the form of a planar graph (or, equivalently, a polygonal subdivision of the two-dimensional Euclidean plane). (iii) Notwithstanding the previous hardness results, we show that efficient exact or efficient approximation algorithms can be designed if one assumes some reasonable restrictions on the map and electoral data. Items (ii) and (iii) mentioned above are the first non-trivial computational complexity and algorithmic analyses of this measure of gerrymandering. (b) On the empirical side, we provide a simple and fast algorithm that can “un-gerrymander” the district maps for the states of Texas, Virginia, Wisconsin and Pennsylvania (based on the efficiency gap measure) by bring their efficiency gaps to acceptable levels from the current unacceptable levels. To the best of our knowledge, ours is the first publicly available implementation and its corresponding evaluation on real data for any algorithm for the efficiency gap measure. Our work thus shows that, notwithstanding the general worst-case approximation hardness of the efficiency gap measure as shown by us, finding district maps with acceptable levels of efficiency gaps could be a computationally tractable problem from a practical point of view. Based on these empirical results, we also provide some interesting insights into three practical issues related the efficiency gap measure.