Tobias Achterberg
unread,Aug 28, 2018, 6:47:40 AM8/28/18Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to gur...@googlegroups.com
Don't get confused by the vector syntax. This has nothing to do with Gurobi.
As far as I understand, with given points (x1,y1), (x2,y2), ..., (xn,yn) you
want to find the point (x,y) that has the smallest sum of Euclidean distances to
the given points. Hence, you want to solve
min sqrt((x-x1)^2 + (y-y1)^2) + ... + sqrt((x-xn)^2 + (y-yn)^2)
What you need to do is to formulate this as a second order cone program (SOCP)
as follows:
min t1 + ... + tn
s.t. x^2 - 2*x*x1 + x1^2 + y^2 - 2*y*y1 + y1^2 <= t1^2
...
x^2 - 2*x*xn + xn^2 + y^2 - 2*y*yn + yn^2 <= tn^2
If you move variables to the left and constants to the right, this looks as follows:
min t1 + ... + tn
s.t. x^2 + y^2 - t1^2 - 2*x1*x - 2*y1*y <= - x1^2 - y1^2
...
x^2 + y^2 - tn^2 - 2*xn*x - 2*yn*y <= - xn^2 - yn^2
Make sure that you create variables x and y as free variables (i.e., with lower
bound -infinity and upper bound +infinity), while the t1,...,tn variables are
non-negative (i.e., lower bound 0, upper bound +infinity).
The constraints are so-called "rotated second order cones", with which Gurobi
can deal with. My guess is that the problem is very easy to solve.
Best regards,
Tobias