Graph theory, NP hard combinatorial optimization and world geography
Graph theory, NP hard combinatorial optimization and world geography
AuthorName
Abstract
Section
Section
I can find a graph of all countries in Eurasia
In[]:=
ℰ=NestGraphCountryData[#,"BorderingCountries"]&,,12;ℰ=UndirectedGraph[ℰ,ImageSize->Full,VertexLabels->(Normal@AssociationMap[Placed[Labeled[#["FlagImage"],#["Name"]],Tooltip]&,VertexList[ℰ]])]
Out[]=
Analyze the structure of the graph. What countries are farthest away and how far are they?
In[]:=
mostDistantCountries=GraphPeriphery[ℰ]
Out[]=
,,
Make a manipulate for FindShortestPath.
In[]:=
DynamicModule{EurasianCountries,countryCenters,shortestPath},EurasianCountries=VertexList[];x(*countryCenters=CountryData[#,"CenterCoordinates"]&/@EurasianCountries;*)(*shortestPath=FindShortestPath[,startingCountry,destinationCountry];*),(*GeoGraphPlot[,GraphHighlight->shortestPath];*),startingCountry,,"Starting country",EurasianCountries,destinationCountry,,"Destination country",EurasianCountries,SaveDefinitions->True
Out[]=
x
