Given a circular array, rearrange the array so that the maximum absolute difference between adjacent elements among all elements is minimum. Can anyone help me with this?
2026-04-13 19:44:24.1776109464
Circular array with minimum absolute difference among adjacent elements
1.3k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
Sounds like that's equivalent to the travelling salesman problem.
https://en.wikipedia.org/wiki/Travelling_salesman_problem
In your case, each element in the array is a city, and the distance between two cities is the difference between each element.
Here's a paper on a fast solution to TSP that I pulled off arxiv:
http://arxiv.org/ftp/cs/papers/0702/0702133.pdf
Here's a fast TSP solving library:
http://cran.r-project.org/web/packages/TSP/index.html
Your edit makes it no longer related to TSP.