minimize avg distance to some points
- To: mathgroup at smc.vnet.net
- Subject: [mg38244] minimize avg distance to some points
- From: Daniel Reeves <dreeves at umich.edu>
- Date: Tue, 10 Dec 2002 04:09:45 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Interesting optimization problem:
Given a list of n-dimensional points, find a point that minimizes the
average distance to all the given points.
For example, here are 4 points in 3-space:
points = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}};
Here's the formula for euclidean distance:
d[p1_, p2_] := Sqrt[Tr[(p1 - p2)^2]]
Now we want to find the point where all the partial derivatives are 0:
eq[i_] := D[Tr[d[Array[z, 3], #] & /@ points], z[i]]
eqs = (eq[#] == 0 & /@ Range[3])
Solve[eqs, {z[1], z[2], z[3]}]
But Mathematica chokes on that...
Any ideas for a better algorithm to find the total-distance minimizing
point (this should work for any dimensions; 16 in my case)?
Thanks!
Daniel
--
Daniel Reeves -- http://ai.eecs.umich.edu/people/dreeves/
Humans are genes' way of making more genes. -- Richard Dawkins