Given the ugly nature of congressional districts, and even one elementary school district in Northern Alexandria, when I heard ACPS was redistricting their elementary schools, I became concerned. I started a project on GitHub to do my own analysis. It's been a fair amount of work, but GIS is fun.

My goal is to model the placement of K-5 students in Alexandria and build districts that minimized distance travelled. Also the assignments must be "stable", where "stable" means there's no 2 kids that would want to swap schools based on distance.

I'm using data from Census, Alexandria GIS, and OpenStreetMap. And I'm using the PostGIS extension to PostgreSQL for spatial analysis.

In an earlier districting project I measured distance as the crow flies, in order to build congressional districts. The issue with that is it completely ignored natural barriers like the Chesapeake Bay. So for this project, I'll use pgRouting to measure distance one would drive to school.

I hope to build a solution a problem that lies between the "single source shortest path" and "all-pairs shortest path" problems. For now I'm leaning towards something like a memoized A* algorithm.

As for the assignments, I'm not sure what to use yet. This problem is unlike k-means because both the location and the capacity of schools is fixed. I'm considering the Stable Marriable Problem (or NRMP), the Assignment Problem, and Hopcroft-Karp Algorithm.

If you're interested, please feel free to fork the project and contribute to it.