Now let's consider how to redistrict a 5x5 grid into 5 contiguous districts of 5 units each. (Gridlandia has grown!) There are 4006 districting plans $\mathcal D$ that satisfy these criteria, and we can construct the metagraph in the same way as before—with a node for each plan and an edge between plans that can be transformed into each other by one step (swapping two cells in adjacent districts). We can write these all down, but the full visualization is hard to work with. Instead, we'll show a local picture of the metagraph where you can see a districting plan and all of the other plans within two steps.

### A local view of the metagraph

Click on a plan in the local metagraph (at right) to put it in the center and study its 2-neighborhood. That is, you see all the plans within two swaps. Note that we're not showing the connections between the neighbors, but only how they relate to the center node. Alternatively, use the panel on the left to build a districting plan $\mathcal D$ from scratch, one district at a time, and jump directly to it. You can change the vote distribution $\Delta$ by clicking the units to toggle the vote between the two parties, and watch the winning side change in the metagraph.

#### Build a Plan $\mathcal D$

#### Current Plan $\mathcal D$

#### Vote Distribution $\Delta$

Click a node to move in the graph

Try exploring: create a distribution $\Delta$ that's about half and half split between the parties, start with any initial plan $\mathcal D$, and try clicking your way around the metagraph and looking for areas that favor one party or the other.

### Statistics over the metagraph

Since there are 4006 possible districting plans, it's hard to use such a zoomed-in view to get a good sense of the universe of possibilities. Furthermore, there are $2^{25}=33,554,432$ possible voting distributions where each square is either a Hearts square or a Clubs square. For a particular vote distribution $\Delta$, we might happen to be in an area of the metagraph where many plans give the Hearts Party the majority of seats, even though globally the Clubs Party does better far more of the time.

Instead of trying to visualize the whole metagraph, we can compute some
**statistics** about all possible $\mathcal D$ with respect
to a fixed distribution of votes $\Delta$ and also for all possible
distributions of votes $\Delta$ with respect to a fixed plan $\mathcal
D$. Below, you can build a plan using the panel on the left, or scroll
back up to pick a plan from the last figure. The selected plan will be
displayed next to the navigator panel. You can click and toggle $\Delta$
as before. Finally, there are two histograms.

The first histogram shows how many Hearts seats your distribution gives over all 4006 possible districting plans. The number of Hearts seats in your selected plan is indicated by the Green bar.

The second histogram fixes your districting plan but varies the vote distribution over all the possibilities with the same proportion of voters for each party. (For instance, if your $\Delta$ has 9 Clubs units, then it is compared against the ${25 \choose 9}=2,042,975$ distributions that are also 36% Clubs.) The number of Hearts seats for your $(\mathcal D,\Delta)$ is indicated by the Blue bar.

#### Build a Plan $\mathcal D$

#### Current Plan $\mathcal D$

#### Vote Distribution $\Delta$

This distribution $\Delta$, all 4,006 plans:

This plan $\mathcal D$, all distributions with 14 Hearts votes:

### Interpretation

How should we interpret this?

#### Fixed $\Delta$, varied $\mathcal D$

Suppose, for a fixed distribution of votes, that your plan performed very extremely: it's in a Green bar that's far to the left or the right of the bulk of the distribution. Perhaps this occurred by chance, but another thing this could mean is that the favored party had a good prediction of where the vote would fall and drew the lines to carefully extract electoral advantage from that pattern—gerrymandering!

#### Varying $\Delta$ with fixed party shares

This lets you explore whether the layout of voters, itself, is skewing the representation away from proportionality. For instance, consider all the voter distributions that have just four Hearts units in the grid. Most of them don't yield even one way to get a Hearts district, but if you place them close together, then over 41% of plans do give representation to the Hearts party. If your $\Delta$ is an outlier, that is supporting evidence that the plan was tailored to that $\Delta.$

Next, we'll look at the 7x7 grid, which has too many valid districting plans for us to actually write down, so we'll have to develop some more sophisticated methods to do these kinds of statistical comparisons.