A case study of congressional districting: “Rocks-Pebbles-Sand” approach

As a case study into an algorithmic approach to congressional districting, North Carolina provides a lot to explore. Statistical modeling has called into question whether recent North Carolina district plans are unbiased. In particular, the literature suggests that the district plan used in the 2016 U.S. House of Representatives election yields outlier results that are statistically unlikely to be obtained without the application of bias. Therefore, methods for creating strong and fair district plans are needed. Informed by previous districting models and algorithms, we build a model and algorithm to produce an ensemble of viable Congressional district plans. Our work contributes a “Rocks-Pebbles-Sand” concept and procedure facilitating reasonable population equity with a small overall number of county splits among districts. Additionally, our methodology minimizes the initial need for granular, precinct-level data, thereby reducing the risk of covert gerrymandering. This case study indicates plausibility of an approach built upon an easy-to-understand intuition.


Introduction
In the complex landscape of congressional redistricting, North Carolina serves as a complex and instructive case study.Our work aligns with existing algorithms in its foundational structure, notably those discussed by Cirincione et al. [1], which also build districts iteratively from smaller units.However, our algorithm departs from uniformity by segregating its operation into discrete phases.Through a hierarchical "rocks-pebbles-sand" strategy, we offer a structured yet nuanced approach to district formation.
A noteworthy advantage of our methodology is its minimization of dependency on granular, precinct-level data, thereby reducing the risk of insidious gerrymandering.Although precinct-based mapping is traditional and widespread, our approach demonstrates that effective districting can commence with fewer, larger building blocks.This facilitates a simplified initial map construction with the option for further granularity in later stages, all while maintaining algorithmic integrity.
Designed for a general audience, our work not only presents a distinct methodology but also underscores the importance of merging pre-split counties, aligning with the broader aim of creating fair and unbiased district plans.This fairness is particularly critical in a state like North Carolina, where recent election outcomes have raised questions about the balance of political representation, as discussed below.
From 2014 to 2020, North Carolina was divided into 13 Congressional districts.In 2014, 2016, and 2018, Democrats won 3 out of 13 seats and Republicans won 10 out of 13 seats.In 2020, Democrats won 5 out of 13 seats and Republicans won 8 out of 13 seats.In Table 1, we show the results of recent United States House of Representatives elections in North Carolina.Since the parties have close-to-balanced vote outcomes in each election, one might wonder if the unbalanced result is due to political gerrymandering or is a natural consequence of North Carolina's spatial partisan distribution and the associated geopolitical structure.Every ten years, states redraw Congressional district lines based on census data.The redistricting of each state is determined by the following criteria: population equity, racial and language minority protections, compactness and contiguity, political subdivisions, and communities of interest (Eckman [2]).
The counties or sub-counties of each district should be geographically contiguous, meaning that one can walk from any point to any other point in the district without going outside of the district.Under the "One Person-One Vote Principle," the population size of each district should be equal or nearly equal, especially in a majoritarian system (Apollonio et al. [3]).Each district should be closely and neatly packed together.Various measures of district compactness appear in the literature.The North Carolina Congressional district map that was used for the 2012, 2016, and 2020 elections is shown in Figure 1.Although the newer Congressional map no longer had a snake-like shaped district like was present in 2014, the outcome in terms of seats won in 2016 and 2018 did not change after the new Congressional map was introduced.Also shown in Figure 1 is a simulated district map created by a panel of retired judges in 2016 as part of a research project into fair redistricting; in Section 5, this map is compared with our simulations and the official district maps.
We dive a little deeper into the 2016 election.
• In 2016, Democrats won the seats in Districts 1, 4, and 12 with close to 70% of the votes in each corresponding district.The margin of victory for Democrats was at least 34% in each of these three districts.On the other hand, the margin of victory for six Republican districts was under 20%.By packing the votes of Democrats into certain areas, map makers may have reduced the influence of votes by Democrats in other districts.• Wake county was split into two sub-counties, with one belonging to District 2 and the other one belonging to District 4. The Republicans won District 2, and the part of Wake county that belongs to District 2 happens to capture all the Republican-leaning precincts within its uncommon shape.Meanwhile, the Democrats won District 4 with about a 36% margin of victory.If we were to split the original Wake county in two by using a roughly horizontal or vertical line, then the Democrats would have a much higher chance of winning both districts instead of one.• Mecklenburg county was split into two sub-counties.The first sub-county belonged to District 9 and it consisted of about 23% of the votes from Mecklenburg county.The second sub-county belonged to District 12 and it consisted of about 77% of the votes.In the first sub-county, Democrats had fewer votes than Republicans, but votes for Democrats were more than twice as many as votes for Republicans in the second sub-county.
In summary, in 2016 the districts that Democrats won tended to have a very large margin of victory, an indicator of possible districting bias.
However, assessing gerrymandering is not an easy task as the redistricting criteria are difficult to rigorously define and assess.Furthermore, the political nature of the redistricting process naturally causes disagreement.Looking at the historical evolution of assessment of gerrymandering, the Supreme Court first found partisan gerrymandering to be justiciable in the Bandemer v. Davis (1985) case (Geldzahler [4]).In Veith v. Jubelirer (2004), five out of nine justices agreed that some standard of gerrymandering might be adopted in the future if such a standard can be found (Grofman and King [5]).Godfrey et al. [6] proposed partisan symmetry which principles two parties to receive the same percentage of seats if they obtain the same percentage of votes.Following the work of Godfrey et al. [6], there was strong agreement in the scholarly community that partisan symmetry was the de facto method to assess gerrymandering (Stephanopoulos and McGhee [7]).However, in a 2006 case, Justice Kennedy expressed concern that such a measure "may in large depend on conjecture about where vote-switchers will reside" (Stephanopoulos and McGhee [7]).Indeed, while partisan symmetry is one useful measure, it has its flaws (see DeFord et al. [8] for a thorough investigation).The interested reader can find further discussion and alternative mathematical approaches to gerrymandering in, e.g., Wang [9] and Stephanopoulos and McGhee [7].Thus, there is a difficulty in a consensus and evaluation of a general gerrymandering criteria.
On the state level, North Carolina passed House Bill 92 (HB92) in 2015.This bill is a step in the right direction to establish a nonpartisan redistricting process.It provides the following redistricting standards: (i) population equity: "districts shall each have a population as nearly equal as practicable to the ideal population," (ii) minimizing county splits: "the number of counties and cities divided among more than one district shall be as small as possible," (iii) contiguity, (iv) compactness, referencing length-width compactness and perimeter compactness measures, and (v) concordance with the Voting Rights Act of 1965 (VRA).
In addition, specific partisan metrics have been used in North Carolina court cases, such as the efficiency gap and mean-median difference measure used in Common Cause v. Rucho (2018) to determine the unconstitutional partisan gerrymander of the 2016 congressional district plan.Common Cause v. Lewis (2019) utilized the lopsided margins test in determining the violation of a state legislative district map.These partisan measures illustrate that partisan bias can exist despite passing traditional metrics.In particular, the 2016 plan was generally adequate in terms of compactness, which is one reason why its unconstitutional partisan gerrymander was not identified until after the fact.
Our main goal is to develop a redistricting algorithm based on intuitive notions that appeal to a broader audience.
While modern computing allows for the creation of sophisticated plans using mathematical measures, we find that only a small number of county splits are necessary to produce plausible results based on the literature and 2015 North Carolina House Bill 92 (HB92).This task of minimizing county splits is also explored by Shahmizad et al. [10] through integer programming.
Although metrics like split pairs suggested by Waschpress and Adler [11] exist for evaluating county splits, they did not offer additional insights in our context due to the small number of county splits in our plans.Our algorithm enables us to construct redistricting plans that meet provided constraints while being straightforward and transparent.This is particularly relevant as the mathematics of gerrymandering can be convoluted and enigmatic.An overview of our approach is presented in Figure 2. To elucidate on existing redistricting algorithms, there are three main classifications according to Herschlag et al. [12].Constructive randomized algorithms generate redistricting plans with an initial random seed and either grow a fixed number of districts or combine small districts until the number of desired districts is achieved (e.g., Cirincione et al. [1], Chen et al. [13], Chen and Rodden [14]).Moving boundary MCMC algorithms begin with a redistricting plan and modify the boundaries according to a target distribution encompassing plausible redistricting criteria (e.g., Herschlag et al. [12], Macmillan [15], Mattingly and Vaughn [16], Bangia et al. [17], Wu et al. [18], Imai [19]).Optimization algorithms seek optimal redistricting plans on a highly non-convex space (e.g., Mehrotra et al. [20], Liu et al. [21]).
While previous discussions have emphasized the need for a more mathematical approach to gerrymandering, there is also a clear reluctance to fully adopt complex methods.Our method, while bearing similarities to constructive randomized algorithms like those of Cirincione et al. [1], introduces a hierarchical strategy that allows for a nuanced yet structured formation of districts without node removal.Our approach is based on an intuitive notion, using a "Rocks-Pebbles-Sand" concept that prioritizes population equity while minimizing county splits.This approach can pass common gerrymandering tests and guarantees fewer county splits compared to existing plans.Additionally, we find that introducing constraints can help address population equity, though it may be difficult to satisfy the exact 0.1% constraint mandated by HB92.For a detailed discussion on the implications of North Carolina's HB92 0.1% population equity constraint and how our algorithm compares, please refer to Appendix A. This constraint is particularly challenging since other factors such as age distribution, voter registration, and turnout can affect the number of votes cast in a VTD, making population representation within the VTD incomplete.Further discussion on HB92's voter equity constraint is available in Appendix A. While we could improve population equity by introducing more potential county splits, we believe our results demonstrate the effectiveness of our method.Our findings can serve as a starting point for other redistricting algorithms, or be fine-tuned post-hoc at the precinct level to satisfy strict population equity constraints, or serve as a baseline for comparing other redistricting algorithms.
The rest of the paper is outlined as follows.Section 2 discusses preprocessing steps to prepare data for the algorithm, which is thoroughly outlined in Section 3. Next, we generate a large sample of plausible redistricting plans according to the algorithm, and apply historical partisan votes for 2016 to the sampled plans as well as the historical North Carolina 2012, 2016 and 2020 plans, as well as the plan proposed by a bipartisan panel of retired NC judges, which has been deemed to be not gerrymandered ( [12]).The results are discussed in Section 5. Lastly, an overall discussion is provided in Section 6.

Pre-processing
Looking at population density in North Carolina, we see that the county population varies from 4,407 to 919,628 among the 100 counties of North Carolina, ranging from 0.05% to 9.64% of the state population.In the pre-processing steps, we apply a splitting process to the three largest population counties.This both helps to minimize county splits and allows for sufficient population share within each voting district (VTD).Splitting of counties can be controversial and can have negative ramifications to the fairness of a district plan, so we have tried to do the splitting in a reasonable manner.

Splitting Counties with Large Population Size
There are two main reasons that we choose to split these three counties.First and foremost, we want to minimize the number of county splits in order to prevent the potential of spreading voters of a particular type to multiple districts.Secondly, these 3 counties are the top 3 counties that have the largest population.Since our primary approach is to minimize the number of county splits, the top three counties are the best choice.
Wake county and Mecklenburg county each have close to 10% of the state population, and each will be split into four sub-counties.Guilford county has about 5% of the state population, and it will be split into two sub-counties.When we split the three largest counties, we make the cuts based on the population density map to ensure population equity.When possible, the split also maximizes potential shared borders with other generalized counties (unsplit counties, or subcounties of split counties).Thus, we are increasing the number of basic territorial units from 100 counties to 107 generalized counties.Figure 3 shows how the splits were performed.For each county that gets split, we assume the number of votes for each sub-county is equal.For example, Mecklenburg has a total of 9.64% of the state population and 349, 300 votes, so each of the four sub-counties will have 2.41% of the state population, which corresponds to 87, 325 votes in each subcounty.This is a reasonable assumption as the cut was made according to the population density map.Hence, boundaries of sub-counties can be "dragged" in order to reach equal VTD population share, while maintaining the adjacency conditions.
Then, we use North Carolina vote outcomes by precinct to approximate the party preference percentages in the sub-counties using the process described below.

Votes Redistribution
In the actual district plan used in the 2016 election, Mecklenburg, Guilford, and Wake counties each overlapped with two districts.For each of these counties, we use the actual votes distribution to guide our data to be used as input to our model, as described below.

Mecklenburg County
In our splitting of Mecklenburg into four sub-counties, Mecklenburg 4 is similar to the Mecklenburg county area that belongs to the actual District 9. Mecklenburg 1, 2, and 3 combined are similar to the Mecklenburg county area that belongs to the actual District 12. Figure 4 shows visually the precinct data for the portions of Mecklenburg belonging to the actual District 9 and District 12, respectively.We approximate the votes for each sub-county accordingly.The actual vote distribution for Mecklenburg County is shown in Table 2. Our splitting of Mecklenburg is shown in Figure 3.The final vote redistribution for our model's sub-counties of Mecklenburg is shown in Table 5.

Guilford County
Similar to Mecklenburg county, the votes of Guilford county were also counted for the sub-counties of Guilford county that we created.See Figure 5 and Table 3 for the actual precinct data and vote distribution.See Figure 3 and Table 6 for our splitting of Guilford and the resulting vote distribution.

Wake County
Similar to Mecklenburg county, the votes of Wake county were also counted for the sub-counties of Wake county that we created.See Figure 6 and Table 4 for the actual precinct data and vote distribution.See Figure 3 and Table 7 for our splitting of Wake and the resulting vote distribution.

Additional Pre-processing
In our modeling, adjacency data for North Carolina counties from the U.S. Census is used.However, there are some ambiguous cases due to weak borders.Take Halifax county and Franklin county as an example; they do share a "border" since there are certain parts of their land that connect, but these connections are extremely weak, meaning they barely connect to each other.Since we will cluster multiple counties into one district, clustering two counties that share an extremely weak connection can result in a district that is not sufficiently compact.Thus, we decide that such pairs of counties are not viewed as adjacent.The full list of our model's non-adjacent county pairs that are different from the U.S. Census data is shown below.
However, this does not mean that these pairs of non-adjacent counties do not have a chance to be included in the same district.Instead, if their common adjacent county gets selected in a district, the pair will have a chance to be included in the later selection process.
As a result of the pre-processing work, we obtain an adjacency network with 107 nodes as shown in Figure 7, representing the 107 generalized counties.An edge between two nodes indicates that the corresponding generalized counties are adjacent.The red nodes are the sub-counties of the three split counties.The associated adjacency matrix is used extensively in our clustering algorithm for forming district plans.
In our algorithm, when it selects the third adjacent county, the county that shares more borders with the selected counties (which can be interpreted as the one that has higher % border shared) will have higher chances than other counties to be selected.

Algorithm for Redistricting of North Carolina
We now describe our clustering algorithm for creating district plans for North Carolina, composed of thirteen districts clustered from 107 generalized counties.Each district to be formed is given a distinct index from 1, 2, . . .13.Each generalized county is given a distinct index from 1, 2, . . .107.
Our algorithm pre-populates the thirteen districts using thirteen "seeds."The seeds are manually chosen with intention.More details on pre-selected counties are discussed in section 3.3.By the design of this algorithm, the preselected seed for each district tends to have a large population size among its neighboring counties.This does potentially rule out the possibility that a district only contains generalized counties with relatively small population sizes.Analysis of results obtained from various sets of seeds indicates strong robustness to our results; many sets of seeds do not yield viable results, and those sets of seeds that do yield viable results give similar conclusions to those we will present in our analysis.
After the initial "seeding", our algorithm then begins adding to each district large populations of generalized counties, and then later on adding smaller generalized counties.We use an analogy for our algorithm of adding to a bottle rocks, then pebbles, then sand.

Clustering Algorithm
Here is a description of our algorithm: 1. Create the 107 × 107 generalized county adjacency matrix A. 2. Create a 60×13 matrix, Sol, in which each column corresponds to a distinct district.3. (i == 1) Input 1st generalized county for each of the 13 districts: 3.1 Sol(1, j) is filled with pre-selected generalized county indices.4. (i == 2) Choose 2nd generalized county for each of the 13 districts: 4.1 For each column j, find all the un-selected indices of adjacent generalized counties of the 1st generalized county in column j.
4.2 Among these indices, pick the generalized county index that has the largest population to become the second generalized county of the district, Sol(2, j).In the case of a tie due to county splits, the tie is broken randomly.5. (i == 3) Choose 3rd generalized county for each of the 13 districts: 5.1 For each column j, find all the un-selected indices of adjacent generalized counties of the 1st generalized county and all the un-selected indices of adjacent generalized counties of the 2nd generalized county in column j. 5.2 Among these indices, pick the generalized county index that has the largest population to become the 3rd generalized county of the district, Sol(3, j).In the case of a tie due to county splits, the tie is broken randomly.6. (i == 4, 5) Choose additional generalized counties for the 13 districts: 6.1 Case 1: For each column j, if the developing district's population is > 6% of the state population, then Sol(i, j) = 0. 6.2 Case 2: For each column j, if the developing district's population is ≤ 6% of the state population, then find all the un-selected indices of adjacent generalized counties for the existing generalized counties in column j and randomly pick one of them to be included in Sol(i, j). 7. (6 ≤ i) Choose additional generalized counties for each of the 13 districts: 7.1 Case 1: For each column j, if the district's population is > 6+ i − 3 3 • 0.45 % of the state population, then Sol(i, j) = 0.
7.2 Case 2: For each column j, if the district's population is ≤ 6+ i − 3 3 • 0.45 % of the state population, then find all the adjacent generalized counties for the existing generalized counties in column j and randomly pick one of them to be included in Sol(i, j).7.3 If all generalized county indices have been selected, then the matrix Sol is complete.Break from the current "for" loop.Otherwise, repeat step 7 until all generalized county indices have been selected.

Algorithm Notes
• We pre-allocated 60 rows to Sol to provide a sufficient number of iterations for simulations to settle in to completion of the matrix Sol.• In the randomized process (starting when i ≥ 4) of selecting generalized counties from the adjacency list, generalized counties that are adjacent to multiple generalized counties in a developing district will be included in the list of adjacent, unselected indices multiple times, resulting in a higher probability that they will get selected.This gives preference to the development of districts that are relatively compact.
• The first three generalized counties of each district have large population size.The purpose of this is to avoid the possibility of grouping many generalized counties with small populations into one district in the beginning, which is likely to lead to a larger population inequity among the districts.The only randomization in the second and third generalized counties of each district is due to the breaking of population ties caused by county splits.• Substantial randomization on selecting generalized counties starts at the 4th row for each district.Population percentage caps are used to let districts that have relatively small populations "catch up" before letting other districts that have relatively large populations continue including more generalized counties into their districts.• Starting with the 6th row, we use a different population percentage cap,

+
i − 3 3 • 0.45 %, and the cap jumps at a constant rate every 3 rows thereafter.The percentage 0.45% is derived from Figure 8.There is a total of 107 generalized counties, and close to half of these have population under 0.5% of the state population.While testing different combinations of numbers for a population cap, we found that usage of 0.45% results in a relatively low standard deviation in district population in resulting district plans.Usage of the floor function gives more room for generalized counties that have similar population sizes to be utilized before the cap is increased again.
-If the percentage that was chosen is too small, say 0.1% instead of 0.45%, then many more iterations are required for the process to terminate, and the resulting district plans tend to have large standard deviations in district population.-If the number that was chosen is too large, say 1% instead of 0.45%, although the algorithm terminates rapidly, the resulting district plans again tend to have large standard deviations in district population.

Selecting Criteria of Pre-selected Counties
In Figure 8, we categorized the 107 generalized counties by population size into 3 categories: rocks, pebbles, and sand.By the design of this algorithm, the pre-selected first counties of each district are either rocks or pebbles, or they have a very large population or are densely populated compared to their neighboring counties.Readers can verify that from Table 8.The counties in red in Table 8 are the pre-selected counties.
Although Wayne and Nash counties do not belong to Pebbles, they have the largest population or population density around their neighboring counties as shown in Figure 9.We are aware that there are other combinations of such criteria that exist, and the reasons for selecting the particular set of the pre-selected counties in this study are based on the combination of the following: • Location of the counties -high-density areas: counties have more adjacent counties -not high-density areas: has the largest population and/or population density around its neighboring counties.
• Population density around its neighboring counties and population size.
• We have tested numerous sets of pre-selected counties to see which ones can provide more plausible district maps while maintaining strong population equity.
With careful consideration, we chose to show this best version of the result from these pre-selected counties as shown in Figure 9 and Table 8.
If the state would like certain counties to be in separate districts, they can use our model and algorithm with modified pre-selected counties.

Ensemble of District Plans
With one million simulations of our algorithm, we obtain an ensemble of one million potential redistricting solutions for North Carolina.We preserve all the county borders except for the three split counties.To reach exact population equity in a district plan, the population percentage of state population in each  district would be 100%/13 ≈ 7.69%.To see the variation across district plans in our ensemble, we compute for each district plan the standard deviation of  the differences in population between the district populations and the ideal district population, with results ranging from 0.32 percentage points to 2.33 percentage points with a mean of 1.11 percentage points.Then, we extract the solutions that have a relatively low population variation among the districts.We consider the solutions that have less than or equal to 1 percentage point of state population standard deviation as "good" solutions.We recognize that here we are taking a different approach than that mandated currently by HB92.
As discussed earlier, we point out that many confounding factors exist (e.g., age distribution, voter registration levels, voter turnout) so that even if a district map reaches the population equity requirement of HB92, it is likely that the number of votes cast varies more than the 0.1% from ideal that HB92 stipulates.We believe that strong results for other measures can plausibly be paired with reasonable population equity levels.Among one million solutions obtained from our simulations, there is a total of 533 duplicate results, which is about 0.05% of the total number of solutions.It is interesting to see that the number of duplicates is quite low.After removing the duplicate solutions, we have a total of 330, 493 "good" solutions.
In Figures 10 and 11, two samples of redistricting solutions in the ensemble supplied by the algorithm are shown.Both part1(:, :, 1) and part1(:, :, 2) are proposed redistricting plans in which each entry (except 0) represents a generalized county and each column represents a district.For display purposes, we have truncated these matrices not to show rows consisting of all zeros.The best solution (in terms of smallest population standard deviation, 0.32 percentage points) from the simulations is shown in Table 9.

Analysis
In this section, we apply several gerrymandering metrics to our ensemble of district plans and analyze the results.

Compactness
Compactness serves as a crucial criterion in redistricting, often used to identify partisan gerrymandering.In North Carolina's HB92, perimeter compactness is highlighted, aligning with our choice of the Polsby-Popper measure.Notably, both the Polsby-Popper and Reock scores were considered in the North Carolina case Common Cause v. Rucho (2018), emphasizing their relevance in evaluating district plans.
Denote ξ = {D 1 , . . ., D 13 } as a district plan containing information for the 13 districts.Compactness metrics are defined per district, and are consequently used to compute both the minimum and average of metric over all D i ∈ ξ.Minimum corresponds to the worst district for that metric, and average as a measurement over the entire district plan ξ.Egregious values in either case can indicate partisan gerrymandering, since it only takes one district to change the number of elected representatives, and an overall score violation implies multiple districts to be affected.
A common measure of compactness is the Polsby-Popper measure, which is defined as For a district that is a perfect circle, P P (D i ) = 1.The scaling factor of 4π normalizes P P (D i ) to be in [0, 1], where P P (D i ) = 1 is the most compact shape based on this measure.An entire plan ξ is often evaluated on its average score, in the NC case given by P P avg (ξ) = 1 13 We remark that this is comparatively equivalent to the Schwartzberg compactness measure in the sense that a district with larger Polsby-Popper score always has a smaller Schwartzberg score and vice versa.

Partisan Measures
The efficiency gap is a measure of the number of wasted partisan votes in an election.Note that in a purely bipartisan election, 50% of votes are wasted (all for the losing candidate, and anything beyond the 50% winning threshold for the winner).If one party has substantially more wasted votes than another, it is potential evidence toward gerrymandering.For a given plan ξ, we formally define efficiency gap(ξ) = [dem.wasted votes] − [rep.wasted votes] votes cast statewide , where dem.and rep.wasted votes refers to the overall statewide wasted votes.In a two-candidate election, this is a number between -0.5 and 0.5, where a strictly positive value indicates gerrymandering against the Democratic Party (strictly negative against Republican).The extreme case of efficiency gap(ξ) ≈ 0.5 implies that all Democratic votes are wasted in each D i ∈ ξ, either in a landslide victory for Democrats, or during a Republican victory by 1 vote.The −0.5 case occurs vice versa.The mean-median difference is a measure of skewness and simply subtracts the median (Democratic) voter percentage over the 13 districts from the mean (Democratic) voter percentage.This is a traditional skewness measure used in statistics, and is interpreted similarly to the efficiency gap in that (large) positive values indicate wasted Democratic votes.
Lastly, the lopsided margin measure subtracts the average Republican winning % out of all Republican winning counties from the average Democratic winning % out of all Democratic winning counties.Note that before differencing, both percentages are greater than 50%.A large value then suggests that the Democratics are wasting votes, from their high average and/or the Republican low average, and vice versa.The histogram in Figure 12 provides a summary of the average Polsby-Popper score (calculated using Equation ( 1)) from the simulations described in Section 4. Overlaid on the histogram are the 2012, 2016, and 2020 North Carolina district plans, as well as the plan proposed by the judges.The results of the historic plans are clearly visible (as seen in Common Cause v. Rucho (2018)), with the 2012 plan demonstrating clear evidence of gerrymandering on the basis of compactness.Also consistent with historic findings is that the 2016 plan manages to produce viable compactness results despite producing a gerrymander.Moreover, our approach shows promise for achieving compactness, with most of the results clustering around the 2020 and judges' plans, and the minimum score close to that of the 2016 plan.Table 10 compares the number of county splits in historic and judges' plans to those generated by our algorithm.Note that the "Our Alg." column refers to the maximum allowed splits; this informs whether a county is available for splitting or not.This table effectively showcases one of the major advantages of our algorithm: it has only a quarter of the maximum allowable splits compared to the 12 fixed splits in the 2020 and judges' plans.

Results
In terms of partisan results, Figure 13 provides a histogram summary of the Efficiency Gap, Mean-Median Difference, and Lopsided Margin measures across simulations.To avoid gerrymandering, these measures should ideally be as close to zero as possible.As seen in the figure, historic consistency is evident, with the 2012 plan being a clear outlier in all categories (aside from Seats Won), as well as the 2016 plan (aside from Mean-Median Difference).Our simulated plans largely cluster around the 2020 plan for efficiency gap, lopsided margins, and seats won, while clustering around the judges' plan for mean-median difference and lopsided margins.However, it is worth noting that plans may pass certain criteria and fail others, as observed with the 2016 plan's performance on mean-median difference.Therefore, it is crucial to evaluate plans across multiple measures.Overall, Figure 13 provides strong evidence that most of the plans generated by our algorithm perform well in terms of each of the partisan criteria mentioned.

Discussion
Political gerrymandering involves a complex network of individuals, including politicians who devise plans, judges who assess political fairness, and voters who belong to communities sharing values and culture, all of whom are invested in ensuring their votes are not invalidated through gerrymandering.The role of mathematicians is also crucial, as they develop criteria for assessing gerrymandering and algorithms for constructing new plans.However, gerrymandering is fundamentally based on obfuscation and the use of esoteric algorithms.
In this case study, our algorithm, based on intuitive notions, has been shown to generally pass common gerrymandering tests and produce results similar to those of judges' and 2020 plans in North Carolina.Our algorithm has verified the gerrymanders of 2012 and 2016 in terms of their compactness and partisan measures.
In future work on North Carolina's districting, we will still heavily minimize the number of county splits, but we will consider splitting the counties differently.Our current splitting technique is an ad hoc process that could be developed further to try to avoid potential manipulative usage of splitting of counties.For cases where additional county splits may be necessary, particularly to meet the stringent HB92 population equity mandate, county split metrics such as split pairs introduced by Waschpress and Adler [11] could offer valuable insights.This metric could provide a more nuanced understanding of the implications of different county-splitting strategies.
Also, county demographics can be taken into consideration to ensure the contiguity of potential communities of interest.Since the "big rocks," which are pre-selected counties, were pre-determined in our model, a few counties will not have a chance to be included in the same district.To better improve our model, we would like to use different sets of pre-selected counties and run the corresponding simulations.Although the logic and steps will be similar in each algorithm based on our model, the characteristics of the pre-selected counties and the algorithm will need to be updated.These characteristics can include county population, the population of neighboring counties, the location and the distance between pre-selected counties, and additional characteristics.
The "Rocks-Pebbles-Sand" approach developed in this case study has useful features for usage in other states as well.Most importantly, our method is easily explainable to politicians, judges, and the general voting public, and emphasizes the importance of preserving communities of interest by minimizing splits and keeping counties intact.The "Rocks-Pebbles-Sand" approach naturally maintains community aspects such as minority percentages, while also honoring the "One Person-One Vote Principle" by choosing population equity to minimize at each step of the algorithm while prioritizing the maps that are relatively compact.As indicated in Appendix A (Figure 14), our method could meet a smaller population equity constraint if it was hard coded into the algorithm (e.g., 1%, similar to the approach used in Cirincione et al. [1]).Although additional splits could feasibly allow for meeting North Carolina's 0.1% constraint, the exact number required and strategy of splitting is left for future work.Our method also provides results that can be easily finetuned to satisfy stricter bounds, such as shifting precincts to satisfy population equity requirements, and is easily adaptable to other states by predetermining natural county splits and building an adjacency matrix.Moreover, additional constraints based on another state legislature can be easily introduced as filtering steps in the algorithm.In summary, this case study indicates the potential of an approach built upon an easy-to-understand intuition.

A Addressing HB92
Among several criteria used to assess potential gerrymandering, population equity quantifies the deviation of the population within a district compared to the ideal population which is the total state population divided by the number of districts.In particular, the population of district D i under census C is defined as  and HB92 requires max i=1,...,13 P E C (D i ) < 0.001, that is, the maximal amount any district can deviate from its ideal population is 0.1%.On one hand, the HB92 principle is just in adherence with the "One Person-One Vote Principle."On the other, confounding factors exist within census population values (e.g., voter registration levels, voter turnout) so that the number of votes cast in a VTD is not fully explained by population representation within the VTD.This is especially true in years toward the end of a decade.Note that the official North Carolina 2020 plan used on the C = 2010 census shifts precinct boundaries to produce perfect population deviation Pop 2010 (D i ) = 0 for all i (up to rounding).However, when the same plan is applied to the census gathered in the year it was used (C = 2020), one finds RMSPD 2020 (ξ 2020 ) = 0.07 and max i=1,...,13 P E C (D i ) = 0.14, 140 times larger than the requirement set by HB92! Figure 14 displays histograms of RMSPD 2020 (ξ) and max i=1,...,13 P E C (D i ) for the district plans generated by our algorithm, with the C = 2020 values overlayed for ξ 2020 .

Fig. 8 :
Fig. 8: Summary of Population Size Among Generalized Counties in North Carolina (A Total of 107 Counties After Splitting)

Fig. 10 :
Fig. 10: Sample Result 1 of a potential redistricting plan for North Carolina from MATLAB.Each entry (except 0) represents a generalized county and each column represents a district.For display purposes, we have truncated the output not to show rows consisting of all zeros.

Fig. 11 :
Fig. 11: Sample Result 2 of a potential redistricting plan for North Carolina from MATLAB.

Fig. 12 :
Fig. 12: Compactness Scores comparison using various measures.The histograms show results for our ensemble of district maps.

Fig. 13 :
Fig. 13: Partisan Scores comparison using various measures.The histograms show results for our ensemble of district maps.

where 13 i=1
Pop C (D i ) is the number of registered voters in D i as accounted for by census C (e.g., C = 2010, 2020, ...), and Pop C,ideal = 1 13 Pop C (D i ).Note that in our application, C = 2010.Herschlag et al. [12] utilizes a root mean squared population deviation measure RMSPD C (ξ

Fig. 14 :
Fig. 14: Root mean squared population deviation and maximum population deviation for our algorithm results.The purple vertical line indicates the 2020 plan (based on the 2010 census) when using the up-to-date 2020 census data.

Table 1 :
Results of the United States House of Representatives Elections in North Carolina from 2014 -2020 (Source: State of North Carolina Election Data, https: //er.ncsbe.gov/).

Table 2 :
Votes distribution of Mecklenburg County using actual 2016 district plan.

Table 3 :
Votes Distribution of Guilford County using actual 2016 district plan.(a)Wake 1 (b) Wake 2 Fig. 6: 2016 U.S. House of Representatives Election Results of Wake County by Precinct (Source: State of North Carolina Election Data, https://er.ncsbe.gov/).

Table 4 :
Votes Distribution of Wake County using actual 2016 district plan

Table 5 :
Votes Distribution of Mecklenburg County using our model's sub counties.

Table 6 :
Votes Distribution of Guilford County using our model's sub-counties.

Table 7 :
Votes Distribution of Wake County using our model's sub counties.

Table 8 :
Population of 107 Generalized Counties (Ranked by Population Size)

Table 9 :
Best solution (in terms of population standard deviation) of the simulation for redistricting of North Carolina with population distribution.

Table 10 :
Number of splits in Counties on North Carolina Congressional maps versus our approach.In the first column, the number of Districts into which a County might be split is indicated."Our Alg." column refers to the maximum possible allowed splits.