Let's consider a region like this:

The aim is to find the "Chebyshev center" of the region. By using the polygons, one can approximate the perimeter of region by an $n$-gon ($n$ is large enough). Then by saving the coordinates of the perimeter in two vectors, say $x$ and $y$, and using Linear programming, compute the minimal-radius ball enclosing the region. But I want to try another way, an optimization!
I have two data sets, produced by MATLAB, (get them from here) and I want to find the Chebyshev center by optimization (not linear programming). From here I learnt how to find the nearest distance of an interior point from it's boundary:
X = "KP" /. imp // Flatten;
Y = "KI" /. imp // Flatten;
pts = Transpose[{X, Y}];
Nearest[pts, {3, 1.5}]
(* {3,1.5} is a sample interior point *)
If I denote the nearest distance by $d$, the aim is to maximize $d$ (or minimize $-d$) over box inside region. (Like $x \in [1.5 \; 4.5] , y \in [0.5 \; 2]$.) The Chebyshev center will be obtained by maximizing $d$. But I can't define to Mathematica how treat with FindMinimum and Nearest.

Nearestcommand likeNMaximize? I'm not sure. – user2667048 Feb 03 '14 at 17:09Nearest[...][[1]]becauseNearestreturns a list. Also your inner function might need to be done asnearest[x_?NumberQ,y_?NumberQ] := nf[{x,y}][[1]]wherenfis aNearestFunctioncreated from your data points. Reason for this is to avoid any attempt by the outer optimization to use symbolic computations since the inner optimizer is in effect a black box. – Daniel Lichtblau Feb 03 '14 at 17:19nearest[x_?NumberQ, y_?NumberQ] := EuclideanDistance[{x, y}, nf[{x, y}][[1]]]– Daniel Lichtblau Feb 03 '14 at 17:36nf[x_, y_] := Nearest[{pts, {x, y} }, 1.5 <= x <= 4.5, 0.5 <= y <= 2]– user2667048 Feb 03 '14 at 17:55Nearest. It doesn't take arguments like 1.5<=x<=4.5. General remark: Go to basic documentation before you go to MSE. – Daniel Lichtblau Feb 03 '14 at 19:10nf = Nearest[pts]; nearest[x_?NumberQ, y_?NumberQ] := EuclideanDistance[{x, y}, nf[{x, y}][[1]]]; FindMinimum[{-nearest[x, y], 1.5 <= x <= 4.5, 0.5 <= y <= 2}, {x, y} ]. I run the code and got result! Is this correct? If yes please answer to this question! – user2667048 Feb 03 '14 at 19:36