I have a problem in which I am given points (e.g., 100 points) with dimensions 12 (a point is like a vector with 12 entries). I want to find a number of points e.g., 8 points that are closest to each other. To do this, I try to find a cluster of 8 points such that the Euclidean distance between the points and the center of the cluster is minimized. The formulation is like this (Note that the formulation below is for 2 dimensions points, not 12 )

min sum_{i=1}^M u_i * [(x_i-x_d)^2+(y_i-y_d)^2]

s.t.

sum_{i=1}^M= K

u_i={0,1} for all i

M is the number of points, e.g, 100

K is the number of the points in the found cluster (similar points)

x_ and y_i are the coordinates of point i

x_D and y_D is the center of the cluster (to be found)

u_i is an indication variable (u_i= 1 if the point i is in the cluster)

We see that due to the multiplication of variables in the objetive function, the problem is not convex . Any idea if the formulation is correct?. Also, how to transform this problem to a convex problem to be solved by cvx

Thank you