I'm trying to solve a clustering problem with size constrains.
Minimize $J=\sum_{i=1}^c\sum_{j=1}^n {{u_i}_j}^2{d_i}_j$
$d_{ij}$ is the distance from each element to it's cluster center. Usually euclidean, but I substitue this with the Haversine formula, since I'm working with geocoordiantes.
$ U = u_{i,j} \in[0, 1],\; i = 1, . . . , n,\; j = 1, . . . , c$
$u_{ij}$ tells the degree to which element $\mathbf{x}_i $ belongs to cluster $\mathbf{c}_j$
Subject to $\forall 1\le j\le n : \sum_{i=1}^c {{u_i}_j}=1$
and $\sum_{j=1}^n {{u_i}_j}=\frac nc$ (size constraint)
I used Lagrange multiplier method based on Fuzzy C-means algorithm, and got the formula
n=number of property $j\in[1,n]$
c=number of cluster $i\in[1,c]$
$L=\sum_{i=1}^c\sum_{j=1}^n {{u_i}_j}^2{d_i}_j+\sum_{j=1}^n\alpha_j(1-\sum_{i=1}^c {{u_i}_j})+\sum_{i=1}^c\beta_j(\frac nc-\sum_{j=1}^n {{u_i}_j})$
A dummy example:
I have 9 points to cluster into 3 groups, to solve the $u_{ij}$ matrix subject to sum of rows equals 1, and sum of columns equals 3(the average cluster size).
$$ \begin{matrix} u_{11} & u_{12} & u_{13}\\ u_{21} & u_{22} & u_{23}\\ \vdots & \vdots & \vdots\\ u_{91} & u_{92} & u_{93} \end{matrix} $$
Then I took the partial derivatives of each variable and solved the system of linear equations using matrix method.
However, after the clusters returned are still uneven. I'm not sure why this doesn't work. There implementation should be correct. So I'm thinking it's the problem with the algorithm. Some how the sum of membership degree doesn't correlated to cluster size as I thought. I don't understand why is that. If this doesn't work, what are the other ways to solve this problem? Any comments are appreciated.