K-Means clustering constrained with minimum and maximum cluster size
K-means clustering implementation whereby a minimum and/or maximum size for each cluster can be specified. This K-means implementation modifies the cluster assignment step (E in EM) by formulating it as a Minimum Cost Flow (MCF) linear network optimisation problem. This is then solved using a cost-scaling push-relabel algorithm and uses Google's Operations Research tools's SimpleMinCostFlow which is a fast C++ implementation.