africa = CountryData["Africa"];

borderQ[cont1_, cont2_] := 
  MemberQ[CountryData[cont1, "BorderingCountries"], CountryData[cont2]];

dist[u_,v_]:=GeoDistance[CountryData[u,"CenterCoordinates"],CountryData[v,"CenterCoordinates"]][[1]];

wmat = Table[If[borderQ[u,v]||borderQ[v,u],dist[u,v],∞],{u,africa},{v,africa}];

coord=Reverse[CountryData[#,"CenterCoordinates"]&/@africa,2];

g=WeightedAdjacencyGraph[africa,wmat,VertexCoordinates->coord,EdgeStyle->White,Prolog->{Hue[.15, .5, .9], 
      CountryData[#, "Polygon"] & /@ africa},ImagePadding->30];

FindShortestPath[g, CountryData["Swaziland"], CountryData["WesternSahara"]]

HighlightGraph[g,PathGraph[%], GraphHighlightStyle->"Thick"]