Improved Redistricting Algorithm – Andy S. (’25)

While redistricting seldom finds its way into the forefront of voters’ minds, its reach touches every aspect of the political systems, oftentimes determining the very direction of a country’s future for years if not decades to come.

Every 10 years in Canada and the US, designated groups redraw the boundaries of every statewide or provincial, and congressional district in the ways in which they see best fit. These districts are the ones in which everyday constituents vote for their representatives in the Canadian House of Commons and US House of Representatives, and yet, this process is entrenched in delays, corruption, and errors.

And while human commissions and legislatures suffice at drawing up decent maps, the sheer scale of operations and the number of the variables make parts of the process more suited to computer algorithms. 

Roughly following this flowchart, the algorithm I developed starts with a randomized map, and makes incremental improvements based upon a variety of factors to create a more and more refined congressional map.

Screenshot from LucidCharts diagram. Created on April 2. Screenshot on May 4

Here is it in action on map of Vancouver using data from the 2020 census:

Andy’s full blog post detailing his work process and code can be found here.

One thought on “Improved Redistricting Algorithm – Andy S. (’25)

Leave a reply to Saints STEM Cancel reply