I used census data, OSM streets, pgrouting, and a k-mean clustering algorithm to build 11 voting districts in Virginia.
https://github.com/openbrian/districtbuilder/wiki/sampled-data,-plain-distance-function
Funding made possible by our generous sponsors