# Point relaxation in high dimensional hypercube

Problem: Given a set $\{\mathbf p_1, \ldots \mathbf p_k\} \subset \mathbb R^n$ of points inside the $n$-dimensional hypercube $[0, 1]^n$, the task is to relocate them such that the distance between each $\mathbf p_i$ and its nearest neighbor is as large as possible.

Comments: Note that the points should not leave the hypercube. Furthermore, I am not allowed to make any assumptions about the initial point distribution other that no two points coincide. The method should compute a "reasonable" solution (not necessarily a global optimum).

Any suggestions for an algorithm? The dimension, $n$, is for sure more than three.

• Does it have to guarantee hitting the global optimum? – user3658307 Feb 13 '17 at 13:26
• No (just edited the question). – user3749105 Feb 13 '17 at 13:31

The easiest thing to try is to use the standard constrained optimization algorithms to solve: \begin{align*} \max_P & \sum_i\sum_j ||\vec{p}_i - \vec{p}_j||_d \\ \text{s.t.}&\;\; \vec{p}_k\in\mathfrak{C}_{\text{unit}}\;\forall\;k \end{align*} for $\vec{p}_j\in P$ and some distance metric $d$.

You could also try to minimize in more of a Gromov-Hausdorff Distance style: \begin{align*} \max_P &\, \min_{i,j} ||\vec{p}_i - \vec{p}_j||_d \\ \text{s.t.}&\;\; \vec{p}_k\in\mathfrak{C}_{\text{unit}}\;\forall\;k \end{align*} Then run any good constrained optimization algorithm on it. I believe there is a convex form, if you are concerned with speed. In terms of software, here are some resources for matlab, python, mathematica, or libraries with multiple language bindings (e.g. this one). I find Differential evolution algorithms to work pretty well if the space is nasty, but this problem seems to be alright. You might even be able to just do gradient descent.

(A not-so-serious idea: make all of the particles charged $+C$ and run a physics simulation, i.e. numerical integration, of the system with your boundary conditions.)

Maybe also check out the paper An Efficient Algorithm for Minimizing a Sum of Euclidean Norms With Applications by Xue and Ye.

Hopefully I understood your question correctly. It doesn't seem like the initial distribution matters all that much, but let me know if I misconstrued something.

• In the first formulation, it seems that the degenerate solution $\mathbf p_i = \mathbf 0, \forall i\,$ leads to the global minimum 0. In the second formulation, you should switch the min and the max: the distance between the nearest neighbors (i.e., the min distance) should be maximized. – user3749105 Feb 13 '17 at 14:21
• Sorry, mixed up the mins and maxs! Thanks @chp.(fixed now) – user3658307 Feb 13 '17 at 14:46
• The maxmin formulation seems to be the right one. However, the algorithms I know of require continuously differentiable functions and the nearest neighbor distance is not such a function. Are you aware of algorithms that do not assume that? Maybe the not-so-serious idea with the charged particles is not so bad after all... – user3749105 Feb 13 '17 at 15:10
• Hm, yeah that formulation is a little tougher. If you look through the libraries I linked, however, you will see that many of the algorithms can take an arbitrary objective function (i.e. it will approximate derivatives or use derivative free methods). You could also consider an evolutionary algorithm, like the differential evolution one I mentioned. Or use formulation 1 with a Minkowski distance with a high power maybe. – user3658307 Feb 13 '17 at 15:19