The problem stated in  is:
In the original problem, the poster talked about the distance between neighbors. But we don't know in advance what the neighboring points are. Of course, we can just generalize and talk about any two points.
- An MINLP problem. The main idea is to get rid of the abs() function as this is non-differentiable.
- A MIP model using binary variables or SOS1 variables. Again, we reformulate the abs() function.
- Apply a fixing strategy to reduce the model complexity. Good solvers actually don't need this.
- A genetic algorithm (ga) approach.