Is there an algorithm (or software) for splitting a map into K connected areas such that the within-area variance of some variable is minimised, and the between-area variance of that variable is maximised?
This seems like it'd be a fairly common problem. For example, one might want to do this sort of thing if one wanted to draw homogeneous electoral districts.