My requirement is to find the point closest to three circles. So lets say the three circles are C1, C2, C3. I want to find the point in the space such that the SUM of its distance from C1, C2 and C3 is MINIMUM.


The distance of a given point from a circle is the distance of the given point from the point that lies on the circle and is intersection of the circle with the line joining the given point with the center of the circle.


I am okay to have the solution in Integer domain, which is where I need your help. I understand the problem can be tackled in Real domain by finding partial derivatives on X, Y axes: See the question in this link: <https://math.stackexchange.com/questions/710547/solving-multivariate-polynomial-to-find-closest-point-to-a-3-or-more-circles>


However I realised that solving the multivariate equations is not easy, and also time taking.


I'm not sure if trying to solve it in Integer domain will make the solution simpler and faster. I'm open to thoughts, and even if there are some approximations which will speed up the algo, I would be glad to listen to them.



Finding closest point to a set of circles
While Douglas's answer will give exact solutions, I would like to suggest two simpler numerical approaches.


**1.** It is clear that the minimum lies in the convex hull of the circles, and that if the sum of distances in the centre of a square of side length $h$ is $S$, its minimum in the square is at least $S-3h/\sqrt{2}$. Thus an algorithm consisting of choosing an initial point and $h$ covering the convex hull.


At each step:


(a) Divide the square into nine smaller squares by adding eight points around each point in the previous iteration. So, if the point is at $(x,y)$, the new points will be at $(x\pm h/3,y\pm h/3)$, $(x\pm h/3,y)$ and $(x,y\pm h/3)$.


(b) Divide $h$ by 3


(c) Compute the sum of distances for each new point, $S(x\_i,y\_i)$ and find the minimum over all points considered so far,


$S\_{\rm min}=\min\_iS(x\_i,y\_i)$


(d) Remove points where the sum of distances is more than $\frac{3h}{\sqrt{2}}$ above this minimum, ie any $i$ for which $S(x\_i,y\_i)>S\_{\rm min}+\frac{3h}{\sqrt{2}}$.


This is guaranteed to converge to the correct minimum, and hopefully answers the integer aspect of the OP's question.


**2.** Still easier (but non-rigorous): Use an out-of-the-box multidimensional optimization algorithm, for example in [mathematica](https://reference.wolfram.com/mathematica/tutorial/ConstrainedOptimizationGlobalNumerical.html) Towards the bottom of that page, four algorithms are described briefly: Nelder-Mead, Differential evolution, Simulated annealing and Random search.


