Implications of Distance over Redistricting Maps: Central and Outlier Maps111Readers are encouraged to see the arxiv version with more results: https://arxiv.org/abs/2203.00872
Abstract
In representative democracy, a redistricting map is chosen to partition an electorate into districts which each elects a representative. A valid redistricting map must satisfy a collection of constraints such as being compact, contiguous, and of almost-equal population. However, these constraints are loose enough to enable an enormous ensemble of valid redistricting maps. This enables a partisan legislature to gerrymander by choosing a map which unfairly favors it. In this paper, we introduce an interpretable and tractable distance measure over redistricting maps which does not use election results and study its implications over the ensemble of redistricting maps. Specifically, we define a central map which may be considered ”most typical” and give a rigorous justification for it by showing that it mirrors the Kemeny ranking in a scenario where we have a committee voting over a collection of redistricting maps to be drawn. We include running time and sample complexity analysis for our algorithms, including some negative results which hold using any algorithm. We further study outlier detection based on this distance measure and show that our framework can detect some gerrymandered maps. More precisely, we show some maps that are widely considered to be gerrymandered that lie very far away from our central maps in comparison to a large ensemble of valid redistricting maps. Since our distance measure does not rely on election results, this gives a significant advantage in gerrymandering detection which is lacking in all previous methods.
1 Introduction
Redistricting is the process of dividing an electorate into districts which each elect a representative. In the United States, this process is used for both federal and state-level representation, and we will use the U.S. House of Representatives as a running example. Subject to both state and federal law, the division of states into congressional districts is not arbitrary and must satisfy a collection of properties such as contiguity and near-equal population. Despite these regulations, redistricting is vulnerable to strategic manipulation in the form of gerrymandering. The body in charge can easily create a map within the legal constraints that leads to election results which favor a particular outcome (e.g., more representatives elected from one political party in the case of partisan gerrymandering). In addition, the ability to draw gerrymandered districts has improved greatly with the aid of computers since the historic salamander-shaped district approved by Massachusetts Governor Elbridge Gerry in 1812. For example, assuming voting consistent with the 2016 election, the state of North Carolina with 13 representatives can be redistricted to elect either 3 Democrats and 10 republicans or 10 Democrats and 3 Republicans.
However, despite this obvious threat to functioning democracy, partisan gerrymandering has often eluded regulation partly because it has been difficult to measure. In response, a recent line of impactful research introduced sampling techniques to randomly generate a large collection of redistricting maps222These are not the truly uniform random samples from the immense and ill-defined space of all possible maps that we ideally want, but they are generally treated as such in courts. (Chikina, Frieze, and Pegden 2017; DeFord, Duchin, and Solomon 2019; Herschlag et al. 2020) and calculate statistics such as a histogram of the number of seats won by each party using this collection. This can show that a proposed or enacted map is an outlier in terms of its election outcome with respect to the sample. In fact, these techniques were used as a key argument in a recent U.S. Supreme Court case on partisan gerrymandering (Rucho v. Common Cause No. 18-422, 588 U.S. 2019) and have supported successful efforts to change redistricting maps in state supreme court cases (LWV vs Commonwealth of Pennsylvania No. 159 MM 2018). More importantly for the present work, at least two states, Michigan and Wisconsin, have used such a sampling tool (DeFord, Duchin, and Solomon 2019) in the recent redistricting process in response to the 2020 U.S. Census (Chen 2021). Recent papers have even extended these methods to locate which regions in a state are most unfairly impacted by a given map (Lin et al. 2022; Ko et al. 2022).
Despite this progress, all of these methods rely on election outcomes to detect any possible gerrymandering. This is a problem in instances where citizens, courts, and/or legislative bodies request methods which do not take partisanship into account. However, there has not been an effective method for detecting gerrymandering by identifying outliers according to a non-partisan metric. Abrishami et al. (2020) make progress toward this goal, but has limitations such a using a small number of samples and not having a clear outlier score (See Section 2 and Appendix C.2 for more details). In this paper, we introduce a framework that resolves these issues and demonstrates the first effective method for detecting gerrymandering based on a distance (dissimilarity) measure over redistricting maps.
Furthermore, while progress has been made on the problem of detecting/labeling gerrymandering through the use of these sampling techniques, the question of drawing a redistricting map in a way that is “fair” and resists strategic manipulation remains largely unclear. We survey some existing proposals to automate redistricting in more detail in Section 2, but none of them have been adopted in practice thus far. Indeed, the issue of finding the “ideal” redistricting map is elusive and one of the main problems in redistricting and gerrymandering. We make progress in this direction, by introducing a novel method which selects the most “central” map. More specifically, given a collection of maps which are voted on by committee members we select the map with the minimum vote-weighted distance from the collection.
1.1 Our Contributions
Our paper introduces a number of contributions:
-
1.
Distance over Redistricting Maps: We introduce a tractable family of distance measures over redistricting maps which have a simple edit distance interpretation. This family of distance measures can be adjusted to accommodate considerations such as a population or path length between voting blocks (Subsection 3.1).
- 2.
- 3.
-
4.
Gerrymandering Detection and Empirical Validation: We show empirically that our framework can be used to detect gerrymandering in some instances. Further, we carry out extensive experimental validation of our pipeline where we ensure convergence and reproducibility by repeating the same experiment using different seeds. Remarkably, we reach the same conclusion across all runs: well-known gerrymandered maps of North Carolina and Pennsylvania have a distance in the 99th percentile away from the centroid map in comparison to an ensemble (Section 6 and Appendix B).
Furthermore, in Appendix C we include more details about gerrymandering detection such as the interpretation of having a large distance from the centroid map and a more detailed comparison to the work of (Abrishami et al. 2020). Finally, we note that our framework can adapt to various considerations such the Voting Rights Act (VRA) (Bickel 1966) and other state-specific redistricting rules by simply modifying the sampling method to adapt to these considerations. Due to the space limits, we delay all proofs to Appendix A.
2 Related Work
Less than a decade ago, several early works ushered in the current era of Markov Chain Monte Carlo (MCMC) sampling techniques for gerrymandering detection (Mattingly and Vaughn 2014; Wu et al. 2015; Fifield et al. 2015). Followup work has both refined these techniques and further analyzed their ability to approximate the target distribution. Authors of these works have been involved in court cases in Pennsylvania (Chikina, Frieze, and Pegden 2017) and North Carolina (Herschlag et al. 2020) with sampling approaches being used to demonstrate that existing maps were outliers as evidence of partisan gerrymandering. One of the most recent works in this area introduces the tool (DeFord, Duchin, and Solomon 2019) which was used by the Wisconsin People’s Maps Commission and the Michigan Independent Citizens Redistricting Commission in the current redistricting cycle following the 2020 U.S. census (Chen 2021). More recently, the works of (Lin et al. 2022; Ko et al. 2022) have made an interesting extension of the previous methods by identifying the voting blocks unfairly impacted in a gerrymandered map. Generally, these techniques have primarily been used to analyze and sometimes reject existing maps rather than draw new maps. However, we may view them as narrowing the search space of maps that can be drawn. Furthermore, it has been shown that even the regulation of gerrymandering via outlier detection is subject to strategic manipulation (Brubach, Srinivasan, and Zhao 2020).
On the automated redistricting side, many map drawing algorithms have favored optimization approaches and in particular, optimizing some notion of compactness while avoiding explicit use of partisan information. Approaches emphasizing compactness include balanced power diagrams (Cohen-Addad, Klein, and Young 2018), a -median-based objective (Bycoffe et al. 2018), and minimizing the number of cut edges (Hettle et al. 2021). Some works include partisan information for the sake of creating competitive districts (districts with narrow margins between the two main parties). The PEAR tool (Liu, Cho, and Wang 2016) balances nonpartisan criteria like compactness (defined by the Polsby-Popper score (Polsby and Popper 1991)) with other criteria such as competitiveness and uses an evolutionary algorithm with some similarity to the random walks taken by MCMC sampling approaches. Other works go further in the explicitly partisan direction such as the game theoretic approach of Pegden, Procaccia, and Yu (2017) which seeks a map that is fair to two parties. Finally, there are methods which prefer simplicity such as the Splitline (Ryan and Smith 2022) algorithm which iteratively splits a state until the desired number of districts is reached.
In all of these approaches, the aim is to automate redistricting, but it is difficult to determine whether the choices made are the “right” or “fairest” decisions. The question of whether optimizing properties such as compactness while ignoring partisan factors could result in partisan bias is a concern. Cho (2019) notes a comment by Justice Scalia suggesting that such a process could be biased against Democratic voters clustered in cities in Vieth v. Jubelirer (Vieth v. Jubelirer No. 02-1580, 541 U.S. 267 (2004). For those that do take partisan bias into account, there are questions of whether purposely drawing competitive districts or giving a fair allocation to two parties are really beneficial to voters.
Finally, the work of Abrishami et al. (2020) introduces a distance measure over redistricting maps. However, our distance is easy to compute and does not require solving a linear program. Further, our focus is on the implications of having a distance measure, i.e. the medoid and centroid maps that will be introduced. Moreover, unlike Abrishami et al. (2020) we can detect gerrymandered maps rigorously by specifying where they lie on a distance histogram without using an embedding method and using samples instead of only . Finally, we give a clear outlier score for a given map (its percentile distance from the central map) whereas (Abrishami et al. 2020) cannot do that. Therefore, it is difficult to see how their methods would be applied in a real practical setting. See Appendix C.2 for a more detailed discussion.
3 Problem Set-Up

A given state is modelled by a graph where each vertex represents a voting block (unit). Each unit has a weight which represents its population. Further, there is an edge if and only if the two vertices are connected (geographically this means that units and share a boundary). The number of units is . A redistricting (redistricting map or simply map) is a partition of into many districts, i.e., where each represents a district and and . The redistricting map is decided by the induced partition, i.e., . For a redistricting to be considered valid, it must satisfy a collection of properties, some of which are specific to the given state. We use the most common properties as stated in (DeFord, Duchin, and Solomon 2019; Hettle et al. 2021): (1) Compactness: The given partitioning should have “compact” districts. Although there is no definitive mathematical criterion which decides compactness for districts, some have used common definitions such as Polsby-Popper or Reock Score (Alexeev and Mixon 2018). Others have used a clustering criterion like the -median objective (Cohen-Addad, Klein, and Young 2018) or considered the total number of cuts (number of edges between vertices in different districts) (DeFord, Duchin, and Solomon 2019). (2) Equal Population: To satisfy the desideratum of “one person one vote” each district should have approximately the same number of individuals. I.e., a given district should satisfy where is a non-negative parameter relaxing the equal population constraint. (3) Contiguity: Each district (partition) should be a connected component, i.e., and , should be reachable from through vertices which only belong to . Our proofs do not rely on these properties and therefore can accommodate additional properties if desired.
Let be the set of all valid maps. Let be a distribution over these maps. Furthermore, define a distance function over the maps . Then the population medoid map is which is a solution to the following:
(1) |
In words, the population medoid map is a valid map minimizing the expected sum of distances away from all valid maps according to the distribution . This serves as a natural way to define a central or most typical map with respect to a given distance metric of interest.
Since we clearly operate over a sample (a finite collection) from ; therefore, we assume that the following condition holds:
Condition 3.1.
We can sample maps from the distribution in an independent and identically distributed () manner in polynomial time.
We note that although independence certainly does not hold over the sampling methods of (DeFord, Duchin, and Solomon 2019; Mattingly and Vaughn 2014) since they use MCMC methods, it makes the derivations significantly more tractable. Further, the specific choice of the sampling technique is somewhat immaterial to our objective.
Based on the above condition, we can sample from the distribution efficiently and obtain a finite set of maps having many maps, i.e., .
Now, we define the sample medoid, which is simply the extension of the population medoid, but restricted to the given sample. This leads to the following definition:
(2) |
3.1 Distance over Redistricting Maps
Before we introduce our distance measure, we note that a given map (partition) can be represented using an “adjacency” matrix in which if and only if otherwise . We note that this adjacency matrix can be seen as drawing an edge between every two vertices that are in the same district, i.e., where . It is clear that we can refer to a map by the partition or the induced adjacency matrix . Accordingly, we refer to the population medoid as or and the sample medoid as or
We now introduce our distance family which is parametrized by a weight matrix and have the following form:
(3) |
where we only require that where is the entry of . For the simple case where , our distance is equivalent to a Hamming distance over adjacency matrices. When , we refer to the metric as the unweighted distance. We note that such a distance measure was used in previous work that considered adversarial attacks on clustering (Chhabra, Roy, and Mohapatra 2020; Cinà, Torcinovich, and Pelillo 2022).
Another choice of that leads to a meaningful metric is the population-weighted distance where . This leads to . The population-weighted distance takes into account the number of individuals being separated from one another when vertices and are separated from one another333Recall that each vertex (unit) is a voting block (AKA voter tabulation district) and units may contain different numbers of voters. by assigning a cost of . By contrast, the unweighted distance assigns the same cost regardless of the population values and thus has a uniform weight over the separation of units immaterial of the populations which they include.
Another choice of metric which is meaningful, could be of the form where is the length of a shortest path between and and is a positive decreasing function such as . Such a metric would place a smaller penalty for separating vertices that are far away from each other. In general, our distance has an edit distance interpretation. Specifically, if we were to draw edges between vertices according to the entries with in the adjacency matrix, then given and , the distance simply equals the minimum total weight (according to ) of the edges that must be added and deleted to obtain from . In the case of the unweighted distance, it is precisely equal to the minimum number of edges that have to be deleted from and added to to obtain . See Figure 1 for an illustration.
4 Justification for Choosing a Central Map
Connection to the Kemeny Rule:
We note that the Kemeny rule (Kemeny 1959; Brandt et al. 2016) is the main inspiration behind our proposed framework. More specifically, given a set of alternatives and individuals voting by ranking the alternatives, the Kemeny rule provides a method for aggregating the resulting collection of rankings. This is done by introducing a distance measure over rankings (the Kendall tau distance (Kendall 1938)) and choosing the ranking which minimizes the sum of distances away from the other rankings in the collection as the aggregate ranking.
Although we do not deal with rankings here, we follow a similar approach to the Kemeny rule as we introduce a distance measure over redistricting maps and choose the map which minimizes the sum of the distances as the aggregate map. In fact, recently there has been significant citizen engagement in drawing redistricting maps. For example, in the state of Maryland an executive order from the governor has established a web page to collect citizen submissions of redistricting maps (Commission 2021). If each member of a committee was to vote for exactly one map in the given submitted maps, then if we interpret the probability for a map to be the number of votes it received from the total set of votes, then the medoid map (similar to the Kemeny ranking) would be the map which minimizes the weighted sum of distances from the set of maps voted on. We include this result as a proposition and its proof follows directly from the definition we gave above:
Proposition 1.
Suppose we have a committee of many voters and that each voter votes for one map from a subset of all possible valid maps , then given a map , if we assign it a probability where is the vote of member for map , then the medoid map is the map that minimizes the sum of distances from the set of valid maps where the distance to each map is weighted by the total votes it receives.
Connection to Distance and Clustering Based Outlier Detection:
The medoid map, by virtue of minimizing the sum of distances, can be considered a central map. Accordingly, one may consider using the medoid map to test for gerrymandering in a manner similar to distance and clustering based outlier detection (He, Xu, and Deng 2003; Knox and Ng 1998). More specifically, given a large ensemble of maps, if the enacted map is far from the medoid444Our experiments use the centroid instead of the medoid map. in comparison to the ensemble then this suggests possible gerrymandering. In fact, we carry experiments on the states of North Carolina and Pennsylvania (both of which have had enacted maps which were considered gerrymandered) and we indeed find the gerrymandered maps to be faraway whereas the remedial maps are much closer in terms of distance.
5 Algorithms
We show our linear time algorithm for obtaining the sample medoid in Subsection 5.1. In Subsection 5.2, we define the population centroid, derive sample complexity guarantees for obtaining it, and show that its entry equals the probability of having and in the same district. Finally, in Subsection 5.3, we discuss obtaining the population medoid and show that in general an arbitrarily large sample is not sufficient to approximate it.
Before we introduce our algorithms, we show that our distance family is a metric (satisfies the properties of a metric):
Proposition 2.
For all such that , the following distance function is a metric.
5.1 Obtaining the Sample Medoid
We note that in general obtaining the sample medoid is not scalable since it usually takes quadratic time (Newling and Fleuret 2017) in the number of samples, i.e. . An run time can be easily obtained through a brute-force algorithm which for every map calculates the sum of the distances from other maps and then selects the map with the minimum sum. However, for our family of distances we show that the medoid map is the closest map to the centroid map (defined below) and show a simple algorithm that runs in time for obtaining the sample medoid. The fundamental cause behind this speed up is an equivalence between the Hamming distance over binary vectors and the square of the Euclidean distance which is still maintained with our generalized distance. Before introducing the theorem we define where the absolute has been replaced by a square. Now we state the decomposition theorem:
Theorem 5.1.
Given a collection of redistricting maps , the sum of distances of the maps from a fixed redistricting map equals the following:
(4) |
where .
Notice that the above theorem introduces the centroid map which is simply equal to the empirical mean of the adjacency maps. It should be clear that with the exception of trivial cases the centroid map is not a valid adjacency matrix, since despite being symmetric it would have fractional entries between and . Hence, the centroid map also does not lead to a valid partition or districting. Moreover, we note that it is more accurate to call the sample centroid, as opposed to the population centroid (see Subsection 5.2) which we would obtain with an infinite number of samples.
The above theorem leads to Algorithm 1 with the following remark:
Remark 1.
Algorithm 1 returns the correct sample medoid and runs in time.
We note that calculating the sample medoid in algorithm 1 has no dependence on the generating method. Therefore, if a set of maps are produced through any mechanism and are considered to be representative and sufficiently diverse, then algorithm 1 can be used to obtain the sample medoid in time that is linear in the number of samples.
5.2 Sample Complexity for Obtaining the Population Centroid
In the prior section, we introduced the sample centroid which is equal to the empirical mean from taking the average of the adjacency matrices, i.e., . We now consider the population centroid . Clearly, by the law of large numbers (Zubrzycki 1972), we have . It is also clear that has an interesting property, specifically the -entry equals the probability that and are in the same district:
Proposition 3.
.
Now we show that with a sufficient number of samples, the sample centroid converges to the population centroid entry-wise and in terms of the value. Specifically, we have the following proposition:
Proposition 4.
If we sample samples, then with probability at least , we have that . Further, let , if we have samples, then with probability at least .
5.3 Obtaining the Population Medoid
Having found the sample centroid and shown that it is a good estimate of the population centroid , we now show that we can obtain a good estimate of the population medoid by solving an optimization problem. Assuming that we have the population centroid , then the population medoid is simply a valid redistricting map which has a minimum value. This follows immediately from Theorem 5.1. More interestingly, we show that this optimization problem is a constrained instance of the min -cut problem:
Theorem 5.2.
Given the population centroid , the population medoid can be obtained by solving a constrained min -cut problem.
If we have a good estimate of the population centroid , then we can solve the above optimization using instead of and obtain an estimate of the population medoid instead of the true population medoid and bound the error of that estimate. The issue is that the min -cut problem is NP-hard (Goldschmidt and Hochbaum 1994; Saran and Vazirani 1995) 555Note that in our case the min -cut problem can have negative edge weights while the min -cut problem is generally stated with non-negative weights. Nevertheless, we still minimize a cut objective and the non-negative weight min -cut instance is trivially reducible to a min -cut instance with negative and non-negative weights.. Further, the existing approximation algorithms assume non-negativity of the weights. Even if these approximation algorithms can be tailored to this setting, the additional constraints on the partition being a valid redistricting (each partition being contiguous, of equal population, and compact) make it quite difficult to approximate the objective. In fact, excluding the objective and focusing on the constraint alone, only the work of (Hettle et al. 2021) has produced approximation algorithm for redistricting maps but has done that for the restricted case of grid graphs. Further, while there exists heuristics for solving min -cut for redistricting maps they only scale to at most around vertices (Validi and Buchanan 2022).
Having shown the difficulty in obtaining the population medoid by solving an optimization problem, it is reasonable to wonder whether we can gain any guarantees about the population medoid by sampling. We show the negative result that we cannot guarantee that we can estimate the sample medoid of a distribution with high probability by choosing a sampled map even if we sample an arbitrarily large number of maps. This implies as a corollary that the sample medoid does not converge to the population medoid in contrast to the centroid (see Proposition 4).
Theorem 5.3.
For any arbitrary many samples there exists a distribution over a set of redistricting maps such that: (1) and (2) where is the medoid cost function.
We therefore, use a heuristic to find the medoid as mentioned in the next section.
6 Experiments

We conduct experiments on three states, North Carolina (NC), Maryland (MD), and Pennsylvania (PA), which have featured in major court cases on partisan gerrymandering (LWV vs Commonwealth of Pennsylvania No. 159 MM 2018; Rucho v. Common Cause No. 18-422, 588 U.S. 2019). The number of voting units (vertices) are around , , and , and the number of districts are , , and for NC, MD, and PA, respectively666For PA, the number of districts was reduced to 17 after the 2020 census, but we are using past election results with 18 districts.. We focus on the results for NC here and discuss the qualitatively-similar results for PA and MD in Appendix B. NC is especially valuable because we have good examples of both gerrymandered and not gerrymandered maps (enacted maps which are widely considered gerrymandered and a remedial map which is not).
To generate a collection of maps, we use the Recombination algorithm, , from DeFord, Duchin, and Solomon (2019) whose implementation is available online. is a Markov Chain Monte Carlo (MCMC) sampling method, and hence, the generated samples are not actually . While this means Condition 3.1 does not hold, we believe our theorems still have utility and future work can address more realistic sampling conditions. Moreover, we always exclude the first samples from any calculation as these are considered to be “burn-in” samples777In MCMC, the chain is supposed to converge to a stationary distribution after some number of steps, called the mixing time. Although the mixing time has not been theoretically calculated for , empirically it seems that steps are sufficient.. Throughout this section, when we say distance, we mean instead of . Further experimental results and figures are included in Appendix B.
Convergence of the Centroid:
Previous work (DeFord, Duchin, and Solomon 2019; DeFord and Duchin 2019) has used the algorithm for estimating statistics such as the histogram of election seats won by a party and determined that using samples is sufficient for accurate results. However, our setting is more challenging. Specifically, the centroid includes entries where is the total number of voting units (vertices) whereas an election histogram includes only entries where is the number of districts—usually orders of magnitude smaller than the number of voting units. Thus, we sample maps instead to estimate the centroid. Here, we emphasize the importance of our linear-time algorithm since using a quadratic-time algorithm on samples of the order of even could be computationally difficult. Following similar practice to Herschlag et al. (2020) for verifying convergence, we repeat the procedure (sampling using and estimating the centroid) for a total of three times for each state, starting from a different seed map each time and confirming that all three runs result in essentially the same centroid estimate.
To verify the closeness of the different centroid estimates, we calculate the distances between them and compare them to their distances from sampled redistricting maps using . We find that the centroids are orders of magnitude closer to each other than to any other sampled map. For example, the maximum unweighted distance between any two centroids is less than whereas the minimum unweighted distance between any of the three centroids and any sampled map is more than . Similarly, the maximum weighted distance between any two centroids is less than whereas the minimum weighted distance between a sampled map and a centroid is at least which is again three orders of magnitude higher.
Distance Histogram and Detecting Gerrymandering:
For each state, we plot the distance histogram from its centroid. More specifically, having estimated the centroid , we sample maps and calculate where is the sampled map. Figure 2 shows the unweighted distance histogram for NC888In Appendix B, we show the histogram for PA and MD as well.. The histogram appears like a normal distribution, peaking at the middle (around the mean) and falling almost symmetrically away. This shows that the maps do not concentrate near the centroid even though it minimizes the sum of distances. Interestingly, the histogram has a similar shape for both distances (unweighted and weighted), and this shape remains unchanged across the different seeds.
Furthermore, previous work used similar sampling methods to detect gerrymandered maps (Chikina, Frieze, and Pegden 2017; Mattingly and Vaughn 2014; Herschlag et al. 2020). In essence, these papers demonstrated that the election outcome achieved by the enacted map was rare in comparison to a large sampled ensemble of redistricting maps. Using similar logic, we can also detect gerrymandered maps. Specifically, the 2011 and 2016 enacted maps of NC were widely considered to be gerrymandered, and both maps are at the right tail of the histogram, far from the centroid. By contrast, a remedial NC map drawn by a set of retired judges (Herschlag et al. 2020) is much closer to the centroid (see Figure 2 red and green marked symbols). Interestingly, all gerrymandered maps are in the 99th percentile in terms of distance (for both distance measures and across three seeds).
This suggests that our method can detect gerrymandered maps with two advantages over previous methods: it does not use election results or partisan outcomes and it is very interpretable. Thus, a guideline or rule that maps should not be far away from the centroid can exist alongside reforms that prohibit explicit partisan consideration.
Finding the medoid:
Since we have shown in Subsection 5.3 that the medoid cannot be obtained by sampling, we follow a heuristic that consists of these steps: (1) Sample maps and pick the one closest to the centroid . (2) Start the chain from but given a specific state (redistricting map) we only allow transitions to new states (maps) that are closer to the centroid, and we do this for steps to obtain the final estimated medoid . We follow this procedure three times one for each centroid 999As mentioned before we get three centroids each from sampling a chain that starts with a different seed.. Figure 3 (top row) shows the medoids from two different runs (each comparing to a different centroid), and it is easy to see they are different. The bottom row shows the final medoids which are visually more similar to each other and also close in distance.

7 Conclusion
In this paper we introduced a framework which accounts for the challenge of choosing from a large space of valid maps in the redistricting process. Specifically, we introduced a well-motivated family of distance measures and showed how we can obtain the medoid map according to this measure. Additionally, we showed experimentally that our framework can be used to find outlier (gerrymandered) maps based on their distance from the centroid map. Finally, we believe that there are further applications of having a distance measure over redistricting maps that are interesting to investigate such as using high dimensional visualization methods to gain further insight into the map ensemble.
References
- Abrishami et al. (2020) Abrishami, T.; Guillen, N.; Rule, P.; Schutzman, Z.; Solomon, J.; Weighill, T.; and Wu, S. 2020. Geometry of graph partitions via optimal transport. SIAM Journal on Scientific Computing, 42(5): A3340–A3366.
- Alexeev and Mixon (2018) Alexeev, B.; and Mixon, D. G. 2018. An impossibility theorem for gerrymandering. The American Mathematical Monthly, 125: 878–884.
- Ashtiani, Kushagra, and Ben-David (2016) Ashtiani, H.; Kushagra, S.; and Ben-David, S. 2016. Clustering with same-cluster queries. Advances in neural information processing systems, 29.
- Bickel (1966) Bickel, A. M. 1966. The Voting Rights Cases. The Supreme Court Review, 1966: 79–102.
- Borg et al. (2013) Borg, I.; Groenen, P. J.; Mair, P.; Borg, I.; Groenen, P. J.; and Mair, P. 2013. Mds algorithms. Applied Multidimensional Scaling, 81–86.
- Brandt et al. (2016) Brandt, F.; Conitzer, V.; Endriss, U.; Lang, J.; and Procaccia, A. D. 2016. Handbook of computational social choice. Cambridge University Press.
- Brubach, Srinivasan, and Zhao (2020) Brubach, B.; Srinivasan, A.; and Zhao, S. 2020. Meddling metrics: the effects of measuring and constraining partisan gerrymandering on voter incentives. In Proceedings of the 21st ACM Conference on Economics and Computation, 815–833.
- Bycoffe et al. (2018) Bycoffe, A.; Koeze, E.; Wasserman, D.; and Wolfe, J. 2018. The Atlas Of Redistricting. https://projects.fivethirtyeight.com/redistricting-maps/. [Online; published 25-January-2018; accessed 15-August-2019].
- Chen (2021) Chen, M. 2021. Tufts research lab aids states with redistricting process. The Tufts Daily.
- Chhabra, Roy, and Mohapatra (2020) Chhabra, A.; Roy, A.; and Mohapatra, P. 2020. Suspicion-free adversarial attacks on clustering algorithms. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, 3625–3632.
- Chikina, Frieze, and Pegden (2017) Chikina, M.; Frieze, A.; and Pegden, W. 2017. Assessing significance in a Markov chain without mixing. Proceedings of the National Academy of Sciences, 114(11): 2860–2864.
- Cho (2019) Cho, W. K. T. 2019. Technology-Enabled Coin Flips for Judging Partisan Gerrymandering. Southern California law review, 93.
- Cinà, Torcinovich, and Pelillo (2022) Cinà, A. E.; Torcinovich, A.; and Pelillo, M. 2022. A black-box adversarial attack for poisoning clustering. Pattern Recognition, 122: 108306.
- Cohen-Addad, Klein, and Young (2018) Cohen-Addad, V.; Klein, P. N.; and Young, N. E. 2018. Balanced centroidal power diagrams for redistricting. In Proceedings of the 26th ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems, 389–396.
- Commission (2021) Commission, M. C. R. 2021. Redistricting Map Submission Process. https://redistricting.maryland.gov/Pages/plan-proposals.aspx. [Online; accessed 20-October-2021].
- DeFord and Duchin (2019) DeFord, D.; and Duchin, M. 2019. Redistricting reform in Virginia: Districting criteria in context. Virginia Policy Review, 12(2): 120–146.
- DeFord, Duchin, and Solomon (2019) DeFord, D.; Duchin, M.; and Solomon, J. 2019. Recombination: A family of Markov chains for redistricting. arXiv preprint arXiv:1911.05725.
- Duchin and Walch (2021) Duchin, M.; and Walch, O. 2021. Political Geometry.
- Fifield et al. (2015) Fifield, B.; Higgins, M.; Imai, K.; and Tarr, A. 2015. A new automated redistricting simulator using markov chain monte carlo. Work. Pap., Princeton Univ., Princeton, NJ.
- Goldschmidt and Hochbaum (1994) Goldschmidt, O.; and Hochbaum, D. S. 1994. A polynomial algorithm for the k-cut problem for fixed k. Mathematics of operations research, 19(1): 24–37.
- He, Xu, and Deng (2003) He, Z.; Xu, X.; and Deng, S. 2003. Discovering cluster-based local outliers. Pattern recognition letters, 24(9-10): 1641–1650.
- Herschlag et al. (2020) Herschlag, G.; Kang, H. S.; Luo, J.; Graves, C. V.; Bangia, S.; Ravier, R.; and Mattingly, J. C. 2020. Quantifying gerrymandering in north carolina. Statistics and Public Policy, 7(1): 30–38.
- Hettle et al. (2021) Hettle, C.; Zhu, S.; Gupta, S.; and Xie, Y. 2021. Balanced Districting on Grid Graphs with Provable Compactness and Contiguity. arXiv preprint arXiv:2102.05028.
- Kemeny (1959) Kemeny, J. G. 1959. Mathematics without numbers. Daedalus, 88(4): 577–591.
- Kendall (1938) Kendall, M. G. 1938. A new measure of rank correlation. Biometrika, 30(1/2): 81–93.
- Knox and Ng (1998) Knox, E. M.; and Ng, R. T. 1998. Algorithms for mining distancebased outliers in large datasets. In Proceedings of the international conference on very large data bases, 392–403. Citeseer.
- Ko et al. (2022) Ko, S.-H.; Taylor, E.; Agarwal, P.; and Munagala, K. 2022. All Politics is Local: Redistricting via Local Fairness. Advances in Neural Information Processing Systems, 35: 17443–17455.
- Lin et al. (2022) Lin, J.; Chen, C.; Chmielewski, M.; Zaman, S.; and Fain, B. 2022. Auditing for gerrymandering by identifying disenfranchised individuals. In Proceedings of the 2022 ACM Conference on Fairness, Accountability, and Transparency, 1125–1135.
- Liu, Cho, and Wang (2016) Liu, Y. Y.; Cho, W. K. T.; and Wang, S. 2016. PEAR: a massively parallel evolutionary computation approach for political redistricting optimization and analysis. Swarm and Evolutionary Computation, 30: 78 – 92.
- LWV vs Commonwealth of Pennsylvania (No. 159 MM 2018) LWV vs Commonwealth of Pennsylvania. No. 159 MM 2018.
- Mattingly and Vaughn (2014) Mattingly, J. C.; and Vaughn, C. 2014. Redistricting and the Will of the People. arXiv preprint arXiv:1410.8796.
- Mead (1992) Mead, A. 1992. Review of the development of multidimensional scaling methods. Journal of the Royal Statistical Society: Series D (The Statistician), 41(1): 27–39.
- Newling and Fleuret (2017) Newling, J.; and Fleuret, F. 2017. A sub-quadratic exact medoid algorithm. In Artificial Intelligence and Statistics, 185–193. PMLR.
- Pegden, Procaccia, and Yu (2017) Pegden, W.; Procaccia, A. D.; and Yu, D. 2017. A partisan districting protocol with provably nonpartisan outcomes. arXiv preprint arXiv:1710.08781.
- Polsby and Popper (1991) 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): 301–353.
- Rucho v. Common Cause (No. 18-422, 588 U.S. 2019) Rucho v. Common Cause. No. 18-422, 588 U.S. 2019.
- Ryan and Smith (2022) Ryan, I.; and Smith, W. D. 2022. Splitline districtings of all 50 states + DC + PR. https://rangevoting.org/SplitLR.html. [Online; accessed 15-August-2019].
- Saran and Vazirani (1995) Saran, H.; and Vazirani, V. V. 1995. Finding k cuts within twice the optimal. SIAM Journal on Computing, 24(1): 101–108.
- Validi and Buchanan (2022) Validi, H.; and Buchanan, A. 2022. Political districting to minimize cut edges. Mathematical Programming Computation, 1–50.
- Vieth v. Jubelirer (No. 02-1580, 541 U.S. 267 (2004) Vieth v. Jubelirer. No. 02-1580, 541 U.S. 267 (2004).
- Wu et al. (2015) Wu, L. C.; Dou, J. X.; Sleator, D.; Frieze, A.; and Miller, D. 2015. Impartial redistricting: A markov chain approach. arXiv preprint arXiv:1510.03247.
- Zubrzycki (1972) Zubrzycki, S. 1972. Lectures in probability theory and mathematical statistics, volume 38. Elsevier Publishing Company.
Appendix A Omitted Proof
We restate the proposition and give its proof: See 1
Proof.
The first step in the proof follows from the definition of the weighted sum of distances for a map from the set of all maps:
∎
We restate the next proposition and give its proof: See 2
Proof.
Since , it is clear that is non-negative, symmetric, and that it equals zero if and only if . The triangle inequality follows since , therefore we have:
∎
We restate the next theorem and give its proof: See 5.1
Proof.
We begin with the following lemma:
Lemma 1.
For any that are binary matrices (entries either or ), with , then we have that .
Proof.
The proof is immediate since and are binary. ∎
It may seem redundant to introduce a new definition since by Lemma 1, they are equivalent. However, we will shortly be using over matrices which are not necessarily binary, clearly then we might have .
We then introduce next lemma:
Lemma 2.
For any two matrices (not necessarily binary), the following holds:
(5) |
where and is the square of the -norm of the vectorized form of the matrix .
Proof.
∎
With the lemmas above, we can now prove the decomposition theorem:
Note that in the fourth line we take the dot product with the matrices being in vectorized form and that . Note that it follows that . ∎
We restate the next proposition and give its proof: See 3
Proof.
By definition of the redistricting adjacency matrices and condition (3.1) for sampling we have that:
∎
We restate the next proposition and give its proof: See 4
Proof.
For a given by the Hoeffding bound we have that:
Now we calculate the following event:
Now we prove the second part. By applying the previous result with set to , we get that with probability at least , . It follows that:
∎
We restate the next theorem and give its proof: See 5.2
Proof.
From Theorem 5.1, the population medoid is a valid redistricting map for which is minimized. Note that since is a redistricting map, unlike it must be a binary matrix. Therefore, , where this identity can be verified by plugging 0 or 1 for and seeing that it leads to an equality. Define the matrix as a “complement” of . Specifically, . It follows that if and only if and are in different partitions and otherwise. Clearly, is a binary matrix. We can obtain the following:
Note that the first sum in the last equality is a constant and has no dependence on . Hence to minimize , we maximize the following:
(6) | ||||
s.t. | (7) |
where the weight is equal to . Clearly, this is a constrained max -cut instance where the partition has to be a valid redistricting map.
∎
Theorem 5.3 shows a negative result for obtaining the population medoid of a set of redistricting maps. Before we show its proof, we show the following theorem which proves a similar result over points in a 2-dimensional Euclidean space. We note that both theorems hold even if the population (true) medoid is sampled with non-zero probability:
Theorem A.1.
There exists a distribution over a set of points in the 2-dimensional Euclidean space such that given many samples the following holds: (1) If then with probability at least we have . However, it is also the case that for any number of samples , we have: (2) and (3) where is the population medoid and is the medoid cost function.
Proof.

Consider the set of points shown in Figure 4. Specifically, points and lie on a circle of radius at an equal separation. Point lies closer to the center of the circle at a distance of . Further, each point has a probability of being sampled. Specifically, and .
The centroid of the distribution is the expected value, i.e. . It is straightforward to show that given samples where , then with probability at least . This follows by applying the generalized Hoeffding inequality (see (Ashtiani, Kushagra, and Ben-David 2016) for example). This proves the first statement.
Now, given a candidate medoid point , the medoid cost function is . Note that the medoid is the value of which minimizes and also must be an element of the set, i.e. . It is easy to verify that . By symmetry it also follows that are each lower bounded by .
On the other hand, we have . Further, for any by setting , and therefore is the medoid. Further, . Therefore, to prove the second and third statements it is sufficient to prove that would be sampled with probability at most in many samples:
Therefore, by setting the distribution satisfies all three statement simultaneously. ∎
Proof.

Consider the hypothetical state shown in Figure 5 where vertices and are further subdividing into two vertices each. We wish to divide the state into districts (). Since each vertex has a weight of , except vertices which each have a weight of , then each district should have a population of to enforce the equal population rule with a tolerance less than .
Denoting the set of all vertices by and letting , then the weight parameters of our weighted distance measure are defined as follows:

Where . Now, consider the maps , and shown in Figure 6. Based on the definition of the weighted distance measure, it is not difficult to see that given maps and , then can be computed visually by drawing the adjacent graphs of and and then finding the minimum number of edges that have to be deleted and added to to produce and adding the weighted of these edges. By following this procedure, we can show that for example as shown in Figure 7. Here we list all distances:
Given a map , the medoid cost function is defined as . Let the probabilities for the redistricting maps be assigned as follows: whereas . Accordingly, .
Further, since , then maximum distance between any redistricting maps can be upper bounded by the highest number of edges that can be deleted and added from one map to produce another, therefore since (see Figure 5). The medoid cost function can be lower bounded for and and upper bounded for as shown below:
Where the last inequality was obtained by setting since it follows that . From the above bounds it follows that the population medoid cannot cannot be , or .
Set and and with , then and . With the population medoid denoted by , then we have: . Further, it follows by the triangle inequality that , thus , since otherwise which would be a contradiction.
From the above we have shown that, and , therefore to prove parts (1) and (2) of the theorem it is sufficient to upper bound the probability of sampling a map that is not in in iid samples by . This leads to the following:
Therefore, from the above we should have to satisfy both parts of the theorem.

∎
Remark:
In both theorems A.1 and 5.3 the probability of “failure” is set to but this is arbitrary as we can make it arbitrarily large by choosing smaller values of . But our objective was simply to show that no sampled map would converge to the population medoid or would have a medoid cost function value that converges to the value of medoid cost function of the population medoid. Further, both theorems would hold if the population medoid is sampled with probability zero, but in our proofs we allowed the population medoid to be sampled with non-zero probability to show that the negative result would still hold even if we were to assume that the population medoid is sampled with non-zero probability.
Appendix B Additional Experimental Results
B.1 Convergence to the centroid
As a reminder to further test the robustness of our results and see the convergence, all calculations are done 3 times for each state, each time starting from a specific seed map101010For MD we use only two seeds and do the calculations twice instead of three times.. For example, we estimate the centroid three times, by sampling starting from seed maps , , and 111111Seed maps are either already enacted maps or produced using optimization functions from the GerryChain toolbox: https://github.com/mggg/GerryChain. and as a result we end up with three centroids , , and . Here we further verify the convergence of the centroids by showing that the final estimated centroids are close to each other. In fact, if we denote the smallest distance between a sampled map and any of the centroids , , or by . Then we consistently find –for all states (NC,PA,MD) and all distance measures (unweighted and population-weighted)– that for any two estimated centroids and that by at least or orders of magnitude. This is strong evidence that while the differences in the estimation may be large in value, they are very small relative to the distances between other maps. Therefore, at this scale the estimation error is small. We note moreover the while we used samples to estimate the centroids for NC, we use only for PA and MD in each seed run and interestingly find that samples are sufficient. Table 1 shows the maximum distance between any two estimated centroid and .
STATE | Distance Measure | ||
---|---|---|---|
NC | Unweighted | ||
NC | Population-Weighted | ||
PA | Unweighted | ||
PA | Population-Weighted | ||
MD | Unweighted | ||
MD | Population-Weighted |
B.2 Distance Histograms and Detecting Gerrymandered Maps
Here we produce the histogram maps for all states and all distance measures. Each histogram is produced for a given state and distance measure starting from a specific centroid and by sampling from its corresponding seed, e.g. we sample maps starting from seed and calculate between a sampled map and centroid to construct one histogram. We find similar observations to Figure 2, indeed we see that the shape of the histograms is stable across all states, distances, and centroids. I.e., all of the distance histograms peak in the middle and fall away from the middle similar to a normal distribution. Further, our observations about the gerrymandered maps of NC (Figure 8) still hold. In addition, we show similar observations in PA where we find that the gerrymandered map that was struck down by the state supreme court (LWV vs Commonwealth of Pennsylvania No. 159 MM 2018) is an outlier in terms of distance. On the other hand, the remedial map has a much smaller distance and appears near the peak of the histogram.
Tables 2, 3, 4, and 5 list percentile distances for the above mentioned maps in NC and PA according to both unweighted and weighted distance measures. We see that the three gerrymander maps (the 2016 and 2011 enacted maps for NC and the 2011 enacted map for PA) are all above the 99th percentile for both distance measures and all three seeds. On the other hand, the NC Judge’s map and PA remedial map are near the peak of the histogram. In addition, the percentiles for these maps are fairly consistent across seeds for any given combination of state and distance measure.



Starting Seed | Judges’ map | 2016 enacted map | 2011 enacted map |
---|---|---|---|
Seed 1 | 58.362 | 99.942 | 100.0 |
Seed 2 | 57.004 | 99.927 | 100.0 |
Seed 3 | 54.558 | 99.943 | 100.0 |
Starting Seed | Judges’ map | 2016 enacted map | 2011 enacted map |
---|---|---|---|
Seed 1 | 65.359 | 99.999 | 100.0 |
Seed 2 | 64.454 | 99.997 | 100.0 |
Seed 3 | 63.238 | 99.996 | 100.0 |
Starting Seed | Remedial map | 2011 enacted map |
---|---|---|
Seed 1 | 49.992 | 100.0 |
Seed 2 | 51.875 | 100.0 |
Seed 3 | 48.715 | 100.0 |
Starting Seed | Remedial map | 2011 enacted map |
---|---|---|
Seed 1 | 22.383 | 100.0 |
Seed 2 | 20.956 | 100.0 |
Seed 3 | 21.813 | 100.0 |
B.3 Finding the Medoid
Similar to the previous experiments, we produce different medoids, one for each state, seed, and distance measure. Having chosen the state and distance measure (unweighted or population-weighted), then for a given centroid and its corresponding seed , we start by sampling maps from the seed and pick the sampled map whose distance is the smallest. We refer to this map as the initial medoid. Clearly, we would have 3 such maps for each state and distance measure. Having found the initial map, we start sampling again but this time starting from the initial map. However, we modify the transition in the chain. Specifically, if we are at a state (map) , then we only transition to a new state (map) if its closer to the centroid, i.e. . Doing this for iterations, we obtain the final medoid. Again we would have one final medoid map for each state, seed, and distance measure. We use for NC whereas for PA and MD we have and . Empirically, we find that and are sufficient (see Table 6 and the rest of this section for more discussion).
Relative Error Measure:
We have seen in Subsection B.1 that we have convergence in the centroid and therefore we assume that we are dealing with one centroid and that is a very good approximation of the population centroid . Since the medoid is supposed to be the closest valid map to the centroid, for any two given mediods and we calculate the relative error between them as follows:
We use the relative error measure to see how the final medoids approximate the medoid cost function relative to one another.
General Observations and Conclusion:
Here we note the observations we reach from the following subsections: (1) For a given state and seed, the initial medoids are the same regardless of distance used (unweighted or population-weighted). (2) For NC and MD, the final medoids are visually very similar, however for PA which is much larger we notice significant differences. (3) Medoid maps can lead to different election results even if they are visually very similar and very close in terms of distance . (4) Medoid maps do not lead to rare election outcomes and the election outcome is at the peak of the election histogram or close to it. (5) The relative error measure over final medoid is in general very small, at most equal to . The fact that we find final medoids with small relative error but that are still different may be explained by the fact that the medoid (or approximate medoids) may not be unique. Regardless, we believe the final medoids maps we obtain are useful as starting maps that can be refined to draw final redistricting maps to be enacted.
Initial Medoids and Final Medoids
Figures 11, 12, and 13 show the initial and final medoids for NC, PA, and MD, respectively. We note that in all figures, that maps in the first column are all using seed and centroid , the second column are using seed and centroid , and so on. Further, the initial medoid maps are found to be the same for both distances (unweighted or population-weighted). In general, we notice that the NC and MD final medoid maps are much similar to one another than PA as there are large regions in PA that are clearly assigned to different districts.



Relative Error between the Final Medoids
Since we have three final medoids for each state and distance measure, we report the maximum relative error value that can be obtained using any pair of maps. Table 6 shows the maximum relative error percentage value, clearly the largest relative error value is at most around .
STATE | Distance Measure | Max Percentage Value Over Final Medoid Pair |
---|---|---|
NC | Unweighted | |
NC | Population-Weighted | |
PA | Unweighted | |
PA | Population-Weighted | |
MD | Unweighted | |
MD | Population-Weighted |
Election Histograms and Medoid Election Results
Here we show the election histogram for each state using votes for a specific election. First, note according to the distribution of votes in each district the number of seats won by a specific party can be calculated. Since we have two-party results, we show only the seats for one party (Democratic party). Finding election histograms using sampling methods is well-established (DeFord, Duchin, and Solomon 2019; Herschlag et al. 2020) therefore we show only one histogram for each state, see Figures 14,15, and 16. We note that the election histograms are the same independent of the choice of seed (as expected). Further, election histograms are not related to a centroid or a chosen distance measure. For each state and distance measure, we record the number of seats for the final medoid maps as shown in the election tables below. In general, medoid maps lead to election results that have high probability, the outcome with the highest probability or close to it. Moreover, we find that the election outcomes of different medoids can significantly overlap.



Starting Seed | Governor 16 | Senate 16 | Presidential 16 |
---|---|---|---|
Seed 1 | 5 | 4 | 5 |
Seed 2 | 6 | 4 | 5 |
Seed 3 | 6 | 4 | 5 |
Starting Seed | Governor 16 | Senate 16 | Presidential 16 |
---|---|---|---|
Seed 1 | 5 | 4 | 4 |
Seed 2 | 6 | 4 | 5 |
Seed 3 | 6 | 4 | 6 |
Starting Seed | Attorney General 16 | Governor 14 | Presidential 16 | Senate 16 |
---|---|---|---|---|
Seed 1 | 8 | 10 | 6 | 6 |
Seed 2 | 8 | 9 | 7 | 6 |
Seed 3 | 7 | 10 | 6 | 6 |
Starting Seed | Attorney General 16 | Governor 14 | Presidential 16 | Senate 16 |
---|---|---|---|---|
Seed 1 | 8 | 9 | 7 | 5 |
Seed 2 | 8 | 9 | 7 | 6 |
Seed 3 | 8 | 10 | 6 | 6 |
Starting Seed | Attorney General 18 | Governor 14 | Presidential 16 | Senate 16 |
---|---|---|---|---|
Seed 1 | 6 | 4 | 6 | 5 |
Seed 2 | 6 | 4 | 6 | 6 |
Starting Seed | Attorney General 18 | Governor 14 | Presidential 16 | Senate 16 |
---|---|---|---|---|
Seed 1 | 6 | 4 | 6 | 5 |
Seed 2 | 6 | 4 | 6 | 6 |
Appendix C Further Details on Gerrymandering Detection
C.1 Gerrymandering Interpretation of Distance Outlier Maps
What does it mean for a map to a have very large distance from the centroid? Here, we show two interesting and mathematically justified interpretations which support the claim that such a map should be considered gerrymandered. For ease of representation, we assume that we are in the asymptotic regime, i.e. :
(1) is Highly Dissimilar from the Ensemble.
We show that the distance from the centroid is a direct measure of the average distance from the ensemble of maps. This follows by direct manipulation of the decomposition theorem 5.1:
(8) |
Therefore, the above equation shows that a map with a large distance from the centroid has to be highly dissimilar from the ensemble. This gives further justification for why maps that are outliers from the centroid such as those of NC and PA (marked in the histograms of Figures 8 and 9) should be considered to be gerrymandered. It also helps explain why maps which are outliers in terms of partisan election results would also tend to be outliers according to our non-partisan metric. Intuitively, maps which produce rare election results with respect to the ensemble should have rare structure with respect to the ensemble. Ideally, the metric we propose is then able to detect abnormal maps which might disadvantage groups beyond those harmed by the typical partisan or racial gerrymandering we know to look for.
Importantly, we note a significant computational advantage, since in general finding the average distance of a map from sampled maps would require time, but with the above equation we only need to find the distance between the map and the centroid.
(2) Separates Same District Vertices and Unites Separated Vertices.
Proposition 3 shows that , i.e., the probability that vertices and are in the same district equals . Therefore consider the unweighted distance, i.e. . It follows that if is abnormally large, then is following a different distribution where on average if vertices and were usually in the same district (i.e., ), they are placed in different districts and if and were usually separated ( i.e., ), they are placed in the same district. A similar interpretation follows for weighted distances, but with the weight taken into account, i.e., higher cost if is larger.
C.2 Comparison to Previous Work on Detecting Gerrymandering
With the exception of the work of Abrishami et al. (2020), the methods that were introduced such as Herschlag et al. (2020); Chikina, Frieze, and Pegden (2017); Ko et al. (2022); Lin et al. (2022); DeFord, Duchin, and Solomon (2019) to detect gerrymandering have all been based on election outcomes and therefore are orthogonal to our work. Now, we provide more details about Abrishami et al. (2020). The work of Abrishami et al. (2020) introduces a distance measure over redistricting, but finding the distance between two maps requires solving a linear program which is significantly more computationally expensive then our distance measure. Further, Abrishami et al. (2020) did not define a medoid or centroid map. Moreover, their work only considered the 2011 and 2016 gerrymandered maps of North Carolina unlike our work which also considered the 2011 gerrymandered instance of Pennsylvania. More importantly, the method used in Abrishami et al. (2020) to show that the 2011 and 2016 North Carolina maps are gerrymandered amounts to sampling 100 maps and then applying multidimensional scaling (MDS) a classical method for visualizing high dimensional data in lower dimensional space (Borg et al. 2013; Mead 1992). Figure 17 is from (Abrishami et al. 2020) and shows the visualization. Note that the 2012 map in the figure is actually the same as the 2011 map we use (the map was enacted in 2011 but used in 2012). One can see that the gerrymandered maps in red lie further away unlike the judges’ map. Based on the above discussion one can identify the following limitations in (Abrishami et al. 2020):
-
1.
Small Sample Size: In previous work in redistricting such as (Chikina, Frieze, and Pegden 2017; DeFord, Duchin, and Solomon 2019; Herschlag et al. 2020) we have seen tens and even hundreds of thousands of maps used to estimate a quantity. However, (Abrishami et al. 2020) only uses 100 maps which is a significant limitation that could put into question the statistical accuracy. This is an outcome of their distance measure which is computationally expensive.
-
2.
Heuristic Method with No Outlier Score: (Abrishami et al. 2020) uses a high dimensional visualization method (MDS). One necessarily loses information when projecting to a lower dimensional space and the final visualization is not considered to give a necessarily accurate view of the data in higher dimensional space. Furthermore, no outlier score is given for the gerrymandered maps, but rather the observation that they appear further away. Not having a clear numerical value is a clear deficiency in this method. Moreover, in Figure 17 there exists a large number of ordinary maps sampled from that are comparatively as far away at the exterior of the visualization as the red gerrymandered maps of North Carolina.
Our framework resolves both issues above. It can use as much as maps or more and gives an outlier score in terms of percentile distance.

Limitation of Our Method:
Our method is a distance (dissimilarity) based method. As we have seen, it resolves significant issues and introduces a rigorous and statistically stable framework to detect maps that are outlier in terms of distance. However, this may or may not be an advantage since a gerrymandering legislature may select a map that unfairly favors it that is close to the ensemble in terms of distance (Duchin and Walch 2021). In general, there is no clean cut approach to detect gerrymandering in any instance. In fact, even using election outcomes it is not in general possible to detect a gerrymandered map. For example, consider the case where the election outcomes are uniformly distributed, this would imply that all outcomes are equally rare.