I’m interested in trying to find the shortest tour around the world. I saw this sample given by Wolfram (attached) to accomplish this, but it uses the centers of countries instead of the capitals. Is there anyway to use CountryData or AdministrativeDivisionData to enable the script to use capitals?
If not, would it be possible for WA to add coordinates for country capitals to CountryData?
Type Ctrl + = and then type “Capital of Japan”. Mathematica will convert this into code for you. The result is:
CountryData["Japan", "CapitalCity"]
This is how you access the capital of a city. The predictive Interface (the bar below the results) will have a button for “Coordinates”. This shows you how to get the coordinates:
You can use this in your code instead of (CountryData[#, “CenterCoordinates”] &)
Some of the data is missing for various reasons. Maybe a country doesn’t have a defined capital for some reason. You’ll need to remove the missing cases. Overall, you want to redefined centers as: