happyjack27 / autoredistrict

Programmatically makes a fair congressional district map (prevents gerrymandering)
GNU General Public License v3.0
89 stars 15 forks source link

connect multi-vtd islands #37

Open happyjack27 opened 8 years ago

happyjack27 commented 8 years ago

detect islands that aren't connected to the biggest region, and connect them (make the closest vtd's neighbors)

i'd say start with the biggest block, and connect up the closest un-connected and spread out from there. (always the closest unconencted to the biggest block)

maybe this feature could be turned on or off.

happyjack27 commented 8 years ago

code is in feature.FeatureCollection.initwards().

doesn't seem to be working right. (tried on wisconsin, expected 2 islands, got 38)

uses breadth-first search 'cause i was too lazy to make a recursive function.