Some time ago I was working with a student on matching point-cloud data from a 3D scanner. We rediscovered the k-d tree proposed by Friedman, Bentley and Finkel in An Algorithm for Finding Best Matches in Logarithmic Expected Time, ACM Transactions on Mathematical Software, Vol 3, No 3, 1977, pp 209-226. Our code ran on GPUs and had an extra step which provided a logarithmic worst-case upper bound, but never mind that.A singe "ruin and recreate all" took 5 minutes single threaded on e5-2680v4 CPU.
That inserts the 100,000 cities at the best possible position into the tour in random order.
Later on average 15% cities are removed and reinserted.
For those between 70,000 and 99,999 distances of possible positions need to be calculated.
That is time consuming.
I try to parallelize that task as it is the biggest runtime for each recreate step.
My feeling is a similar hierarchical data structure to a k-d tree along with some sort of pruning may allow reduction of the search over 70,000 to 99,999 insertion points to a fraction of that. I would expect the speedup to scale in proportion to the size of the problem divided by the size of the ruin (up to a logarithmic factor).
Also, if I understand this ruin and recreate idea correctly, the ruin happens only in a localized region. Assuming multiple ruins that don't overlap, would a coarse grained parallelization also be possible where multiple ruins are processed simultaneously?
One more question. I've not looked at the code, but I imagine a ruin and recreate cycle might end up with a longer tour than the original. Have you tried an annealing temperature that statistically keeps non-optimal cycles?
A related parallel idea in the spirit of a genetic algorithm is to perform 144 independent optimization runs in parallel each with a different random initialization. After a set number of ruin and recreate cycles, keep the best 25 tours, duplicate and redistribute the best tours among the cores and then repeat by performing another set of independent ruin and recreate cycles.
The three kittens recommend to add some new randomly-initialized tours at the duplicate and redistribute step. I'm not sure.
It would be interesting to hear what happens and, of course, the results when running on a Pi cluster as well as the Lenovo.
Statistics: Posted by ejolson — Sat Aug 16, 2025 10:08 pm