Question

I want to try my hand at finding heuristics/approximations for solving the Traveling Salesman Problem, and in order to do that, I'm looking for some "hard" TSP instances (along with their best known solutions) so that I can try solving them and see how well I can do.

Ideally, they would be simply a text-based list of adjacency matrices or adjacency lists (I don't want to deal with parsing, just the algorithm).
By "hard", I mean that they should be practically impossible to solve or approximate using brute-force.
(This is so that I can be reasonably confident that if I find an answer close to the best known answer, then I'm actually doing something right, and not just getting lucky.)

Are there any lists that would work for this purpose? I searched around a bit but didn't find anything.

Was it helpful?

Solution

Here is another question on SE partially answering your problem (it lists problems, but most of these seems not to have a solution provided, but you better check the links anyway - things may have changed).

If you can't find them, what about randomly generating a set of nodes along with a path connecting them, saving the path length as "minimal" (making sure that the longest connection between two nodes is never > X) and then adding a bunch of other paths making sure these are all > X?

This way (unless I am missing something) you have a set of connected nodes "as complex as you want" and know the actual shortest connecting path from the start...


Addendum - if you really want to see how you compare to existing tools, then you have to run these on your generated problems. One that is free and accessible (but I don't know how "efficient" it may be) is the TSP Library for R.

Wikipedia has a list of other free sw packages for this.

Maybe you could create a different SE question asking for how to get other TSP tools.

OTHER TIPS

The TSP gatech site seems to be the canonical site for TSP information.

Here's a list of the available datasets: http://www.tsp.gatech.edu/data/index.html

The optimal solution is available for some datasets with over 10 000 cities. And there are datasets available of over 1 000 000 cities.

There is a well-known algorithm for finding the optimum TSP solution - it is called brute force.

So the only real way you can compare two algorithms has to be on the quality of the solution as well as some other criteria - usually running time.

Even here you run into a problem. Many algorithms are effectively search algorithms, and the longer you search the more possible solutions are evaluated. The algorithms already trade off quality and running time. They may or may not result in the correct (best) answer for some or all graphs.

The only real way you are going to be able to compare your algorithm to others is by implementing the other algorithms then throwing yours and them the same hard problems (and as others have identified, it is easy to make at least some types of hard problems). Implementing these existing algorithms may suggest ways of improving yours. http://en.wikipedia.org/wiki/Travelling_salesman_problem has plenty of algorithms, and at least a couple look very easy to code. Why not implement them as the first benchmark for your algorithm?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top