Pennsylvania Fair District Rules

In a decision handed down on January 22, 2018 by the Pennsylvania Supreme Court, they decreed that gerrymandered districts shall be thrown out and replaced such that (emphasis mine):
any congressional districting plan shall consist of: congressional districts composed of compact and contiguous territory; as nearly equal in population as practicable; and which do not divide any county, city, incorporated town, borough, township, or ward, except where necessary to ensure equality of population. 
I stared at this paragraph for a boggled minute because the English clauses aren't clearly laid out in a prioritized order. Rationalizing it combined with what I know of redistricting law, I think the priority has to work out to be:

  1. contiguous
  2. equal population
  3. whole towns
  4. compact
If that is a complete statement of what the Pennsylvania courts want out of a district map, it's relatively simple. I clearly need to get hacking on the municipality-preserving version of my compact district solver.


  1. Would this work?

    Draw map with census blocks. Identify smallest county fragment (intersection of county and district). Mark that county as excluded for the district. Possibly change weight for district to account for loss in population, and assign blocks to nearest(weighted) center, treating blocks in an excluded county as being at infinite distant.

    One might also mark all counties that the initial districts do not extend into as excluded. You might visualize a hull of whole counties around each district and slowly pushing hulls inward, forcing districts outward to conform to their hull elsewhere.

    One would have to ensure that some county divisions are maintained for equal population reasons. If you have a network with nodes representing districts, and links between adjacent districts, then trim the network to a minimum number of links, with districts adjacent only along county boundaries not being linked.

  2. You obviously knew about this:


    But you may not have known it has gone public in the last few days.

  3. Ohio provide an interesting model for dealing with how to keep counties and cities whole: