Fairmandering: Generating Fairness-optimized Political Districts, https://sinews.siam.org/Details-Page/fairmandering-generating-fairness-optimized-political-districts, Wes Gurnee and David Shmoys
If you generate a hierarchically-organized and large family of partitions of a state into contiguous equal-population regions, you can then optimize over the hierarchy for fairness. Gurnee and Shmoys choose to optimize the efficiency gap (https://en.wikipedia.org/wiki/Efficiency_gap) but their method is a two-edged sword: it would work equally well to optimize for partisan advantage.