.... | ![]() |
|
.... |
![]() |
![]() ![]() World TSP ![]() National TSPs ![]() TSP Home Page ![]() ![]() ![]() ![]() TSP Links
|
![]() |
![]() Cost Function for the World TSP Instance (GEOM-norm) ![]() We use an array lat of doubles to hold the latitude of the cities and an array long to hold the longitude of the cities (each array is of length equal to the number n of cities in the TSP instance). The function geom_edgelen (i, j, lat, long) will return the cost of travel between cities i and j (where the cities are numbered from 0 up to n-1). To obtain the proper prototypes, the code should include math.h.
The code below replaces an earlier version that was based on the TSPLIB GEO norm.
The new code is less sensitive to machine-dependent rounding issues.
Last Updated: March 19, 2003
|