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: 8 months ago
JSON representation
Benchmark of Hilbert Curve Sort on the TSPLIB Dataset
- Host: GitHub
- URL: https://github.com/carbonicsoda/tsp-hilbert-curve-benchmark
- Owner: CarbonicSoda
- Created: 2024-11-14T04:42:57.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-10T08:29:58.000Z (9 months ago)
- Last Synced: 2025-02-10T09:30:11.064Z (9 months ago)
- Topics: benchmark, mathematics, travelling-salesman-problem
- Language: C++
- Homepage:
- Size: 8.29 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 in both C++ and JS.
Particularly, the famous [pla85900.tsp](pla85900.tsp) set containing 85900 nodes.
The result is quite fascinating to me.
HilbertCurveSort2D (h2CurveSort), an 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,
however this is usually minor.
#### Tour Visualization
_Optimal Tour_

_Hilbert Curve Tour_

> 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.