# A Political Redistricting Tool for the Rest of Us - Sweepcircle Redistricting

Author(s):
Evan Kleiner (Whitman College) and Albert Schueller (Whitman College)

### Sweepcircle Redistricting

To improve the compactness of the regions in equal population partitions, we start with the most compact geometric shape-the circle. In this scheme, now considering Washington state with its current 10 congressional districts, we start with a manually placed set of 10 points within the state that will serve as the centers of 10 sweepcircles expanding at the same rate as in this figure.

Redistricting with expanding sweepcircles.

The sweepcircles are allowed to expand until they encompass their share of the total population—in this case 1/10 of the total population. When a sweepcircle reaches this threshold, it ceases to expand while the remaining sweepcircles continue to expand. Notice in this figure that the circles in the Seattle area, 5, 6, 7, 8, and 9, have already halted because they have reached their population quota. This algorithm derives from a similar algorithm for computing Voronoi tessellations based on sweep circles. [Schueller]

In that algorithm, grid points at the boundary of the expanding sweepcircle "claim" neighboring open grid points. When a grid point encounters a grid point that has been claimed by another sweepcircle, a simple tie breaker is invoked and the disputed grid point is assigned to the region with the closer center.

In general, the resulting partition fails to generate a good set of districts. Still expanding circles wrap around halted circles often forming non-compact districts (though of equal population). Fortunately, the failed partition can often be used to inform us how to adjust the starting centers to generate a better set of districts. The reader can experiment with the iterative process of drawing districts based on sweepcircles using this applet.

The direct application of the results in Schueller to this problem is complicated by the fact that the computations occur on the surface of a sphere instead of on a flat plane. In the remainder of this section, we discuss, in the context of Schueller, how to address this complication.

Recall that the population density function is defined on a discrete mesh of points that is uniform in latitude and longitude. However, the distances between points in that mesh are not uniform as they lie on the surface of the earth (see figure).

The sweepcircle algorithm addresses the issue of generating expanding circles on rectangular grids as in this figure. In particular, it outlines a method of analyzing neighborhood sets around grid points to grow circular regions on discrete rectangular grids. The rate at which the sweep circle grows must be controlled in such a scheme or the circular geometry will be lost. This method allows the expanding regions to respond to and yield when other expanding regions are encountered.

Sweepcircle progression on a uniform, rectangular mesh using Neumann neighborhoods
(only north, south, east, west gridpoints).

The algorithm we employ in the applet uses Moore neighborhoods (see the red and yellow points in this figure). The Moore neighborhood of a grid point is made up of the 8 surrounding grid points. Compare this, for example, to the Neumann neighborhood where only the north, south, east, and west grid points are considered neighbors of the center point. The choice of neighborhood set affects the rate at which the sweepcircles can expand.

Haversine Distance. The notion of distance is important to the sweepcircle algorithm. In contrast to flat space, this mesh lies on the surface of the earth that we approximate by a sphere. The distance between two points on the surface of a sphere, if one is restricted to the surface of the sphere, is given by the length of the segment of the great circle that lies between the two points. Consider two such points in spherical coordinates ${\bf p}_1 = (R,\phi_1,\theta_1)$ and ${\bf p}_2 = (R,\phi_2,\theta_2)$. This distance is given by the Haversine distance function [Sinnott] $d({\bf p}_1, {\bf p}_2) = 2R \arcsin \left( \sqrt{\sin^2 \left( \frac{\phi_2-\phi_1}{2} \right) + \cos(\phi_1) \cos(\phi_2) \sin^2 \left( \frac{\theta_2 - \theta_1}{2} \right) } \right).$

To apply the algorithm, we must determine the initial radius of the sweep circle, $r_0$, and the radial increment of the sweep circle at each step, $\Delta r$. The initial radius is the smallest circumscribing circle of the Moore neighborhood set. The radial increment is the largest inscribed circle in the Moore neighborhood set. A typical Moore neighborhood in the discretization of a spherical patch in the northern hemisphere is shown in this figure.

A Moore neighborhood projection stretched according to the Haversine distance function. Line segments of like color represent like Haversine distances.

Radial Increment. Choosing a $\Delta r$ that is too small will not affect the algorithm, so we find an inscribed circle for a neighborhood along the northernmost latitude where the neighborhoods are smallest. Such a $\Delta r$ will then be appropriate for all of the neighborhoods in the grid.

Assuming a Moore neighborhood, to find the inner radius of a northernmost neighborhood, we need to find the minimum Haversine distances between neighbors shown in light blue (horizontal) and those shown in green (vertical) in the figure. A circle whose radius is the minimum of these distances will be inscribed like the red, dashed circle in the figure.

Referring to the discretization used for the population density function, we assume a mesh size in the longitudinal direction $h=\frac{\theta_{\max}-\theta_{\min}}{N}$ and in the latitudinal direction $k=\frac{\phi_{\max}-\phi_{\min}}{M},$ we compute these distances.

The vertical distances (green) are the same and, with respect to the Haversine function, are characterized by having endpoints with equal longitudes, say $\theta_i$. The distance function is simplified by this observation and is given by $2R \arcsin \left( \left|\sin\left( \frac{k}{2} \right)\right| \right).$ For small, positive $k$, this simplifies to $Rk$.

As noted, we are only concerned with distances along the top edge of the neighborhood set because, for grids in the northern hemisphere, the top edge distances are the shortest horizontal distances. The horizontal distances along the top edge are the same and are characterized by having endpoints with equal latitude, $\phi_{\min}$. This again simplifies the distance function and the distances are given by $2R \arcsin \left( \left|\cos(\phi_{\min}) \sin \left( \frac{h}{2} \right) \right| \right).$

Hence, a radial increment that will enable the sweep circle algorithm to work correctly is $\Delta r = R \min\left\{k, 2\arcsin \left( \left|\cos(\phi_{\min}) \sin \left( \frac{h}{2} \right) \right| \right) \right\}.$

Since the patch is in the northern hemisphere, we can drop the absolute values to get $\Delta r = R \min\left\{k, 2\arcsin \left[ \cos(\phi_{\min}) \sin (h/2)\right] \right\}.$

Initial Radius. Similarly, choosing an $r_0$ that is too large will not adversely affect the sweepcircle algorithm, so we find a circumscribing circle for a neighborhood along the southernmost latitude where the neighborhoods are largest. Such an $r_0$ will then be appropriate for all of the neighborhoods in the grid.

We will find the maximum of the diagonal Haversine distances shown in dark blue and purple in this figure for a neighborhood at the southernmost boundary of the patch. Since our patch is in the northern hemisphere, it is clear that the lower diagonals are the longest (and have the same length) hence it suffices to compute the length of one of these diagonals. Supposing that we consider the neighborhood with its lower right corner at $(\phi_{\max},\theta_{\max})$, the length of this diagonal and hence the radius of a circumscribing circle is $r_0=2R \arcsin \left( \sqrt{\sin^2 \left( \frac{k}{2} \right) + \cos(\phi_{\max}) \cos(\phi_{\max}-k) \sin^2 \left( \frac{h}{2} \right) } \right).$

The Redistricting Applet. The applet included in this paper is written in the Processing programming environment. It is able to run in Javascript enabled browsers via the Processing.js library. The algorithm used to draw the expanding circles is based on sweepcircles with parameters computed according to the formulas derived in this section.

The user is invited to place the centers of the sweepcircles and to execute the algorithm. There are 10 centers corresponding to the 10 congressional districts that Washington currently claims. A score is generated that attempts to rate the quality of your districting plan. The score is a combination of how much unclaimed population remains at the conclusion of the algorithm and how compact the regions are. The user, informed by the current districting scheme and the score, is then allowed to move each of the 10 centers and re-execute the sweepcircle algorithm in hopes of improving the districts and the score.

Evan Kleiner (Whitman College) and Albert Schueller (Whitman College), "A Political Redistricting Tool for the Rest of Us - Sweepcircle Redistricting," Convergence (October 2013)