Home>Articles>Algorithms Cure Gerrymanders, But Politics Remains

The first draft of redrawn 2023 Congressional districts.(Photo:wedrawthelinesca.org)

Algorithms Cure Gerrymanders, But Politics Remains

Special interests, even in this one-party state, demand districts in which they believe they can control the elections

By Edward Ring, October 20, 2022 7:14 am

With the midterm elections just a few weeks away, across California politicians have had to scramble more than usual to compete in redrawn districts. The new district boundaries were the product of the “2020 California Citizens Redistricting Commission,” which was formed to eliminate partisan politics from being a factor.

Partisan politics is not really the issue in California, however, since Democrats have wielded nearly absolute political power in the state for nearly 30 years. So why is it that the final district maps are so contorted?

Have a look at California’s new U.S. Congressional Districts, using an image taken from the final maps page on the California Redistricting Commission’s website and presented below. Sadly, because the contortions are so intricate, the image only shows those districts in the Los Angeles area. Do these districts follow logical lines of geography, or are they a bit twisted?

Congressional District 42 is a prime example of a district drawn in defiance of logic. Its southern end is down in Long Beach, but as it stretches to the northeast it thins to a sliver to take in a slice of Lakewood and Bellflower, then widens a bit to incorporate parts of Downey, then bends northwest to take in Huntington Park at its northern end. What machinations went into defining CD 42? It wasn’t logic.

CD 45 is similarly bent, but in a reverse arc. It starts in the south in Fountain Valley, then moves northwest to take in Westminster, then turns back to the northeast to accommodate Buena Park, then continues moving east to grab parts of Yorba Linda. Across Los Angeles, and across the state, examples of pretzel shaped districts are plentiful.


There is another way to shape the districts our politicians represent. The capacity to use algorithms that manipulate geographic units at the precinct level to shape districts with equal numbers of residents and logical boundaries is well established. Several resources immediately available online document this: A 2021 math thesis “Repairing Redistricting: Using an Integer Linear Programming Model to Optimize Fairness in Congressional Districts” is one example that deigns to explain its concepts in plain English. Further good references can be found here, and here.

2022 study posted on ScienceDirect titled “An algorithmic approach to legislative apportionment bases and redistricting” is also readable and discusses some of the challenges, as well as how software developed just in the last few years can solve them.

For example, when directing an algorithm to iterate a set of district boundaries while maintaining equal populations and solving for convex edges and minimizing the cumulative length of the polygons formed by the districts, the user must specify the initial geographic centers of each district. With multiple solutions possible, this placement affects the results. While the latest software copes well with this challenge, moving the centers automatically as it iterates towards a solution, one would think defining centers is a subjective choice that could be left to a nonpartisan commission. After all, geographic district “centers” ought to mean downtowns of the larger cities.

At every level, geographic logic eluded California’s redistricting commission, as evidenced by this map of California’s new State Senate districts.


In the Los Angeles area, SD 34 is a prime example of illogical boundaries. It starts in Santa Ana, moves north into Anaheim, the marches northwest through Fullerton, then northeast to top out in La Habra, while adding, through an isthmus barely 500 feet wide, a peninsula of constituents in the neighborhoods of Colima and Leffingwell.

These gyrations – have a look at SD 30 and SD 22 before turning from the above map, bearing in mind the entire state is just as weird – are not necessary. In a 2019 paper “Automated Congressional Redistricting,” the authors describe “swapping algorithms” that exchange voters by swapping boundaries to rationalize the shape of districts while retaining the same populations in both districts. This can be part of the iterative process. Why, for example, wouldn’t SD 30 absorb the Colima and Leffingwell neighborhoods from SD 34, while SD 34 picked up the preposterously contrived peninsula of SD 37 in northern Fullerton, while SD 37 grabbed portions of Rancho Santa Margarita from SD 38, and so on?

The answer is not blowing in the wind. It’s special interests, even in this one-party state, demanding districts in which they believe they can control the elections. Have a look at the champion for mangled district boundaries, the California State Assembly: