I'm looking for an example of Python implementation of contiguity constrained clustering algorithm.
The task I want to perform is to reduce the number of administrative zones by grouping them into as homogeneous regions as possible.
Input is a bunch of shapefiles with assigned features.
Restrictions that must be met:
- adjacency of grouped zones
- sum of selected features (e.g. population) within newly created groups must be between selected bounds.
Good example of such algorithm, and basically what I want to achieve, is Skater used in ArcGIS tool:
Another tool is GeoDa https://geodacenter.github.io/ but there is no API available so it's not intended for automated jobs.
I've found some code performing this task however it's been written for python 2.7 and hasn't been updated since years.