Suppose you’d like to tour Africa, visiting each country once, then returning to your starting point, minimizing the distance traveled.
Here’s my first attempt at a solution using Mathematica, based on an example in the documentation for FindShortestTour
.
africa = CountryData["Africa"] FindShortestTour[africa] GeoGraphics[{Thick, Red, GeoPath[africa[[%[[2]]]]]}]
This produced the following map:
Hmm. Maybe I should have been more specific about what I mean by “Africa.” My intention was to find a tour of continental Africa, i.e. not including islands. This means I needed to remove several items from Mathematica’s list of African countries. Also, I had in mind sovereign states, not territories of overseas states and not disputed territories.
After doing this, the map is more like what I’d expect.
The tour is then
- Algeria
- Tunisia
- Libya
- Egypt
- Chad
- Central African Republic
- Democratic Republic of the Congo
- Burundi
- Rwanda
- Uganda
- South Sudan
- Sudan
- Eritrea
- Djibouti
- Somalia
- Ethiopia
- Kenya
- Tanzania
- Malawi
- Zambia
- Mozambique
- Zimbabwe
- Eswatini
- Lesotho
- South Africa
- Botswana
- Namibia
- Angola
- Republic of the Congo
- Gabon
- Equatorial Guinea
- Cameroon
- Nigeria
- Niger
- Mali
- Burkina Faso
- Benin
- Togo
- Ghana
- Ivory Coast
- Liberia
- Sierra Leone
- Guinea
- Guinea-Bissau
- Gambia
- Senegal
- Mauritania
- Morocco
The initial tour, including islands, foreign territories, and Western Sahara, was 23,744 miles or 38,213 kilometers. The second tour was 21,074 miles or 33915 kilometers.
Here’s a tour of just the islands, excluding foreign territories.
The order of the tour is
- Cape Verde
- Seychelles
- Mauritius
- Madagascar
- Comoros
- São Tomé and Príncipe
This tour is 13,034 miles or 20,976 kilometers.
Update: See the next two posts for tours of the Americas and Eurasia and Oceania.
What single point is associated with each country that is then used for the tour? Is it some geometric feature (there could be problems with center of gravity or similar with concave countries) or an arbitrary point given by Mathematica?
It looks to me like John is using the center of gravity? Wouldn’t it make more sense to do a tour of the capitals? That is what I was expecting.
I used Mathematica’s default because that was easiest, but I could see why you might want to look at a tour of capitals instead.
For pedagogical purposes, say memorizing a map by memorizing a tour, I think it would be better to use centers.