Hostname: page-component-588bc86c8c-6qrs9 Total loading time: 0 Render date: 2023-11-30T14:22:07.069Z Has data issue: false Feature Flags: { "corePageComponentGetUserInfoFromSharedSession": true, "coreDisableEcommerce": false, "useRatesEcommerce": true } hasContentIssue false

Gerrymandering and Compactness: Implementation Flexibility and Abuse

Published online by Cambridge University Press:  16 December 2020

Richard Barnes*
Energy & Resources Group, UC Berkeley, Berkeley, CA94720, USA. Email: Berkeley Institute for Data Science, UC Berkeley, Berkeley, CA94720,  USA Computer Science and Artificial Intelligence Laboratory (CSAIL), MIT, Cambridge, MA02139,  USA. Email:
Justin Solomon
Computer Science and Artificial Intelligence Laboratory (CSAIL), MIT, Cambridge, MA02139,  USA. Email:
Corresponding author Richard Barnes


Political districts may be drawn to favor one group or political party over another, or gerrymandered. A number of measurements have been suggested as ways to detect and prevent such behavior. These measures give concrete axes along which districts and districting plans can be compared. However, measurement values are affected by both noise and the compounding effects of seemingly innocuous implementation decisions. Such issues will arise for any measure. As a case study demonstrating the effect, we show that commonly used measures of geometric compactness for district boundaries are affected by several factors irrelevant to fairness or compliance with civil rights law. We further show that an adversary could manipulate measurements to affect the assessment of a given plan. This instability complicates using these measurements as legislative or judicial standards to counteract unfair redistricting practices. This paper accompanies the release of packages in C++, Python, and R that correctly, efficiently, and reproducibly calculate a variety of compactness scores.

© The Author(s) 2020. Published by Cambridge University Press on behalf of the Society for Political Methodology

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)


Edited by Jeff Gill


Alexeev, B., and Mixon, D. G.. 2017. “An Impossibility Theorem for Gerrymandering.” arXiv:1710.04193 [math.CO].Google Scholar
Altman, M. 1998. “The Consistency and Effectiveness of Mandatory District Compactness Rules.” Chapter 2 of “Districting Principles and Democratic Representation,” Ph.D thesis. California Institute of Technology. Scholar
Altman, M., and McDonald, M. P.. 2011. “BARD: Better Automated Redistricting.” Journal of Statistical Software 42(4):128.CrossRefGoogle Scholar
Ansolabehere, S., and Palmer, M.. 2016. “A Two-Hundred Year Statistical History of the Gerrymander.” Ohio State Law Journal 77:741762.Google Scholar
Archambault, V., and M’ndange-Pfupfu, A.. 2017. “qgis-compactness.” Scholar
Barnes, N. 2010. “Publish Your Computer Code: It is Good Enough.” Nature 467(October):753.CrossRefGoogle ScholarPubMed
Barnes, R. 2018. “Compactnesslib.” Scholar
Barnes, R., and Connors, J.. 2018. “mandeR: Compactness Measures.” Scholar
Barnes, R., and Solomon, J.. 2020a. “Reproduction Materials for: Gerrymandering and Compactness: Implementation Flexibility and Abuse.” Code Ocean, V1. Scholar
Barnes, R., and Solomon, J.. 2020b. “Replication Data for: Gerrymandering and Compactness: Implementation Flexibility and Abuse.”, Harvard Dataverse, V1, UNF:6:Xvgi9wCdqvqLAYPLh0E1NA== [fileUNF].Google Scholar
Bernstein, M., and Duchin, M.. 2017. “A Formula Goes to Court: Partisan Gerrymandering and the Efficiency Gap.” Notices of the AMS 64(9):10201024.CrossRefGoogle Scholar
Chambers, C., and Miller, A.. 2010. “A Measure of Bizarreness.” Quarterly Journal of Political Science 5(1):2744.CrossRefGoogle Scholar
Chambers, C. P., Miller, A. D., and Sobel, J.. 2017. “Flaws in the Effciency Gap.” Journal of Law & Politics 33:1.Google Scholar
Deetz, C. H., and Adams, O. S.. 1934. Elements of Map Projection with Applications to Map and Chart Construction. 4th edn. US Government Printing Office for Department of Commerce’s Coast/Geodetic Survey.Google Scholar
DeFord, D. et al. 2018. “Total Variation Isoperimetric Profiles.” arXiv:1809.07943.Google Scholar
Duchin, M., and Tenner, B. E.. 2018. “Discrete Geometry for Electoral Geography.” arXiv:1808.05860 (August): [physics.soc-ph].Google Scholar
Eig, L. M, and Seitzinger, M. V.. 1981. “State Constitutional and Statutory Provisions Concerning Congressional and State Legislative Redistricting.” Library of Congress, Congressional Research Service.Google Scholar
Gärtner, B. 1999. “Fast and Robust Smallest Enclosing Balls.” Algorithms-ESA 1999:693693.Google Scholar
Gelman, A., and Loken, E.. 2013. “The Garden of Forking Paths: Why Multiple Comparisons can be a Problem, Even When There is no “Fishing Expedition” or “p-hacking” and the Research Hypothesis was Posited ahead of Time.” Technical report, Department of Statistics, Columbia University.Google Scholar
Gillies, S., et al. 2007. Shapely: Manipulation and Analysis of Geometric Objects. San Francisco: Scholar
Goldberg, D. 1991. “What Every Computer Scientist Should Know About Floating-Point Arithmetic.” ACM Computing Surveys (CSUR) 23(1):548.CrossRefGoogle Scholar
Goodfellow, I. J., Shlens, J., and Szegedy, C. 2014. “Explaining and Harnessing Adversarial Examples.” arXiv:1412.6572.Google Scholar
Ince, D. C., Hatton, L., and Graham-Cumming, J.. 2012. “The Case for Open Computer Programs.” Nature 482(February):485488. ScholarPubMed
Ioannidis, J. P. A. 2005. “Why Most Published Research Findings are False.” PLoS Medicine 2(8):e124.CrossRefGoogle ScholarPubMed
Jenness, J. S. 2004. “Calculating Landscape Surface area from Digital Elevation Models.” Wildlife Society Bulletin 32(3):829839.[0829:CLSAFD]2.0.CO;2.CrossRefGoogle Scholar
Legislative Technology Services Bureau. 2017. “Wisconsin State Assembly Districts. acquired 02017-08-28.Google Scholar
Merali, Z. 2010. “Why Scientific Programming does not Compute.” Nature 467(October):775777.CrossRefGoogle Scholar
Metric Geometry and Gerrymandering Group. 2018. “python-mander.” Scholar
Niemi, R. G. et al. 1990. “Measuring Compactness and the Role of a Compactness Standard in a Test for Partisan and Racial Gerrymandering.” The Journal of Politics 52(4):11551181. Scholar
OSGeo. 2017. “GEOS—Geometry Engine, Open Source.” Scholar
Polsby, D. D, and Popper, R. D.. 1991. “The Third Criterion: Compactness as a Procedural Safeguard Against Partisan Gerrymandering.” Yale Law & Policy Review 9(2):301353.Google Scholar
QGIS Development Team. 2017. QGIS Geographic Information System. Open Source Geospatial Foundation. Scholar
Ramachandran, G., and Gold, D.. 2018. “Using Outlier Analysis to Detect Partisan Gerrymanders: A Survey of Current Approaches and Future Directions.” Election Law Journal: Rules, Politics, and Policy 17(4):286301. Scholar
Reock, E. C. 1961. “A Note: Measuring Compactness as a Requirement of Legislative Apportionment.” Midwest Journal of Political Science 5(1):7074.CrossRefGoogle Scholar
Snyder, J. P. 1984. “A Low-Error Conformal Map Projection for the 50 States.” The American Cartographer 11(1):2739.CrossRefGoogle Scholar
Stephanopoulos, N. O., and McGhee, E. M.. 2014. “Partisan Gerrymandering and the Effciency Gap.” The University of Chicago Law Review 82:831900.Google Scholar
Supreme Court of Pennsylvania. 2018. League of Women Voters v. Commonwealth, No. 159 MM 2017, 2018 Pa. LEXIS 438 (January 22, 2018) supplemental opinion at League of Women Voters v. Commonwealth, 2018 Pa. LEXIS 771 (February 7, 2018).Google Scholar
Supreme Court of the United States. 1986. Davis v. Bandemer, 478 U.S. 109.Google Scholar
Supreme Court of the United States. 2004. Vieth v. Jubelirer, 541 U.S. 267.Google Scholar
Tam Cho, W. K., and Liu, Y. Y.. 2016. “Toward a Talismanic Redistricting Tool: A Computational Method for Identifying Extreme Redistricting Plans.” Election Law Journal 15(4):351366.CrossRefGoogle Scholar
Towns, J. et al. 2014. “XSEDE: Accelerating Scientific Discovery.” Computing in Science & Engineering 16(5):6274.CrossRefGoogle Scholar
U.S. Geological Survey (USGS). 2016. “USGS National Elevation Dataset (NED) 30m Version.” Google Scholar
United States Census Bureau. 2016. “Cartographic Boundary Shapefiles.” Scholar
United States Federal Courts. 2016. Whitford v. Gill, 218 F. Supp. 3d 837 (W.D.Wis. 2016), stayed pending appeal 137 S. Ct. 2289 (June 19, 2017).Google Scholar
Veomett, E. 2018. “Effciency Gap, Voter Turnout, and the Effciency Principle.” Election Law Journal: Rules, Politics, and Policy 17(4):249263.CrossRefGoogle Scholar
Von Koch, H. 1904. “Sur une courbe continue sans tangente obtenue par une construction géométrique élémentaire.” Arkiv för matematik, astronomi och fysik utgifvet af Kungl Svenska vetenskapsakademien 1:681702.Google Scholar
Wilkinson, M. D. et al. 2016. “The FAIR Guiding Principles for Scientific Data Management and Stewardship.” Scientific Data 3(1):160018. ScholarPubMed
Supplementary material: Link

Barnes and Solomon Dataset