Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/carbonicsoda/tsp-hilbert-curve-benchmark

Benchmark of Hilbert Curve Sort on the TSPLIB Dataset
https://github.com/carbonicsoda/tsp-hilbert-curve-benchmark

benchmark mathematics travelling-salesman-problem

Last synced: 4 days ago
JSON representation

Benchmark of Hilbert Curve Sort on the TSPLIB Dataset

Awesome Lists containing this project

README

        

A simple benchmark on how well the [Hilbert Curve Sort](https://github.com/CarbonicSoda/hilbert-curve-sort) performs on the TSPLIB dataset.
Particularly, the famous [pla85900.tsp](pla85900.tsp) set containing 85900 nodes.

The result is quite fascinating to me.
h2CurveSort, a fast algorithm that is not designed for TSP problems,
achieved a distance of 188465250 (CEIL_2D), only a rough x1.32 of the Mathematically optimal distance 142382641 (CEIL_2D).
That might seem quite bad, but many dedicated approximation algorithms do no better, yet this algorithm is more efficient.

A slight flaw of using the Hilbert Curve Sort to approximate TSP solutions, is that TSP asks for a _cycle_, not a simple tour.
Hilbert Curve Sort will not minimize the distance between the first and the last node, adding an overhead to the resultant distance.

#### Tour Visualization

_Optimal Tour_

![Optimal Tour](assets/pla85900_optimal.png)

_Hilbert Curve Tour_

![Hilbert Curve Tour](assets/pla85900_hilbert_curve.png)

> Notice an additional horizontal line near the bottom of the tour connecting the bottom-left and the bottom-right. This is an example of the flaw I mentioned above.