Perhaps you can create your own test data?
This will definitely not be exhaustive testing, but it can help. Note: The Hamiltonian path is shown below, and if you are looking for loops something like this will work.
You can do the following:
Say you are given an undirected graph G with n nodes.
Now you create a weighted graph G 'by setting the weight of the edges in G to 1 and adding edges not to G and giving them a random weight> 1, i.e. G 'is a complete graph with weights assigned to all its edges.
Now, if you run the current TSP algorithm on G 'and generate a path of size n-1, then G has a Hamiltonian trajectory. Otherwise, G does not have a Hamiltonian trajectory.
So, now you can use graphs you know that have / don't have Hamiltonian paths (for example: Hypercube has Hamiltonian paths) and generate test data for your TSP algorithm.
This page has some sufficient conditions that may be useful when creating graphs that have Hamiltonian paths: http://www-math.cudenver.edu/~wcherowi/courses/m4408/gtln12.html
I believe you will not be able to find data on graphs with / without Hamiltonian paths.
Hope this helps. Good luck
Aryabhatta
source share