Question

Travelling Salesman with latitude/longitude coordinates?

I am reading about many heuristics for the TSP and many use Euclidian x/y coordinates. But I have my data as latitude and longitude, so how do I use those heuristics? That is, is there a meaningful way to go from latitude/longitude to x/y coordinates?

Thanks

Was it helpful?

Solution

For the score function, you can just use Pythagoras directly on the latitude and longitude to calculate the distance between 2 points.

To visualize it in a panel with a specific width and height, take a look at my LatitudeLongitudeTranslator (java, open source, ASL 2.0) which is used in this TSP GUI.

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