Skip to content

hamodikk/algorithmic-rediscticting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MSDS 460 (Group) Assignment 3

This repository includes the work done for the third assignment of the MSDS 460 class. This project has been completed by Sally Lee, Eve Huang, Maddy Lok, Jake Baker and Hamdi Kucukengin. It takes an integer programming approach in Python to creating a redistricting plan for the state of Washington.

Table of Contents

Introduction

Redistricting in the United States is the process where the electoral district boundaries are redrawn after each ten-year census. More information on the relevancy of this practice can be found in this article.

Our goal with this project is to define a redistricting plan, while keeping in mind the one-person/one-vote goal. We achieve this goal by setting limits on populations for each district and determining an ideal redistricting plan that tries to balance population of each district. We achieve this by setting up the problem as an integer programming problem and solving it using Python's PuLP library.

Data Sources

The data on Washington state counties was obtained from World Population Review, which provided a list of each county and their total population in 2024. To determine the percentage of the population identified as “white alone”, data for each county was gathered from the US Census Bureau. Finally, the Washington Secretary of State website provided an export of the state’s 2024 election results. This export provided results for all elections across each county. The data was filtered to include only statewide elections for president, senator, and state governor. During data cleaning, the party column was standardized, as both “GOP” and “Republican” were present. “GOP” was replaced with “Republican” to match the assignment wording. Since the focus is on the two major US political parties, independent candidates and write-ins were removed.

There are no concerns about the data provided by the sources above. Two of them are from official government sources and the other was provided by the assignment.

Specification

To examine the fairness of "one person, one vote," we need to analyze population distribution and districting. In our model, we set the desired district population at 750,000 with six districts. We then calculate the ideal population by dividing the state's total population by the number of districts. The objective function calculates the absolute difference between the projected population of each district and this ideal population. Since we aim to minimize deviation from the ideal population regardless of whether it's an over- or underrepresentation, the objective function seeks to minimize the total absolute population deviation across all districts. The optimization problem then seeks to find the optimal assignment of counties to districts (represented by variables) that minimizes this deviation, potentially incorporating other relevant objectives.

Programming

The Python code for the problem setup and solution has been provided here with annotations for each section of the codes function. The program is written in Python using the PuLP library. The program includes the loading of the data, pre-processing, creation and solution of the integer programming problem. Finally, it creates the redistricting plan.

Additionally, we wrote a Python code using the geopandas library to create the map for our redistricting plan. The program generates the following map using the redistricting plan.

Solution

With the optimal solution, Washington state is suggested to be redistricted into 10 districts. In our original code, the program could not provide an optimal solution due to the unbalanced population allocation, especially in King County and Pierce County, which occupied 40% of the population in Washington state. Therefore, we separated the programming for those two counties and added a population tolerance of 15%. After solving the integer programming problem, we added back the two counties making up four districts. The specifics of the King and Pierce County segmentation are unable to be calculated by our model as it only uses county data, however our approach ensures each district will have roughly the same population.

Maps and Discussion

Here is the current Washington congressional districts map:

Current_WA_District_Plan

Running the PuLP code, we get the following results for the redistricting plan:

redistricted_map

Redistricted districts may not be adjacent, unlike the current map. As the program considers the fairness of population distribution to ensure one person, one vote, the geographic distribution may be inconsistent and non-adjacent. A disadvantage of this solution might be confusion for people when voting and increased administrative or management expenses for the local government.

About

MSDS 460 Group Assignment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages