Category Archives: Recreational

Number of Neighbors for World Countries

Number of Neighbors for World Countries

One important geographical aspect in economy is whether a country is land-locked. Another aspect is the number of neighbors a given country shares a border with. If we sort all 239 world countries, 75 (31%, almost one third) of them are island countries such as Madagascar or Australia where this number is zero. On the opposite end are countries with the most border connections. Here are the top 6 countries in descending order: China (16), Russia (14), Brazil (10), Sudan, Germany, and Democratic Republic of Congo (9 each). All other countries have 8 or less neighbors. Here is a visual breakdown:

The histogram shows the high frequency of island states; the range from 1 to 5 neighbors is fairly common, with a steep drop off in the frequency of 6 or more neighbors. Here is a world map with the same color-code:

WorldMap color-coded by number of neighboring countries

Large countries tend to have more neighbors (Russia (14), China (16), Brazil (10)), but there are obvious exceptions to this tendency (Canada (1), United States (2)). The number of neighbors depends not just on the size of the country itself, but on it’s neighbors’ sizes as well; for example, a small country such as Austria (land area size world rank: 116th) has a rather high number of 8 neighbors because many of them in turn are relatively small (Switzerland, Liechtenstein, Slovenia, etc.).

The average number of neighbors is about 2.7 and there are 323 such border relationships. These can be visualized as graphs with countries as vertices and borders as edges. (Note that to simplify the graphs I excluded all 75 islands = disconnected vertices except Australia.) There are two main partitions of this graph following the land-border geography: One with Europe, Asia and Africa and one with the Americas.

Border-Connected Countries in Europe, Asia, Africa

With the graph layout changed from “Spring Embedding” to “Spring Electrical Embedding” one obtains this interesting variation of the same graph which looks like a sword fish:

The "EurAsiAfrica Sword-fish"

The other partition of the Americas can be visualized in a circular embedding layout:

Europe, Asia, Africa (left) and Americas (right)

It is also interesting to look at the numbers for lengths of pairwise borders between two countries:

  • Number: 323 border-pairs
  • Minimum: 0.34 [km]
  • Maximum: 8893 [km]
  • Mean: 789.6 [km]
  • Total: 255048 [km]
  • Most pairwise borders are between 100 – 1000 km long, but they can as short as 1/3 km (China – Macau) or almost 9000 km (Canada – United States).

    When we look at the entire border length for each country, we see familiar names on top of the ranking:
    China: 22147 [km], Russia: 20293 [km], Brazil: 16857 [km], India: 14103 [km], Kazakhstan: 12185 [km], United States: 12034 [km]. It seems likely that the first four, the so called “BRIC” countries, owe part of their economic strength to their geography: Size, length of borders and number of neighbors influence the number of local trading partners and routes to them. There are many more correlations one can analyze such as between border length / number of neighbors and GDP / length of road network etc. One thing seems likely when it comes to the economy of world countries: Size matters, and so does Geography!

    Epilog: This analysis was all performed using Wolfram’s Mathematica 8. The built-in curated CountryData provides access to more than 200 properties of the world countries, including things like Population, Area, GDP, etc. Some cleaning of the borders lengths data was required to deal with different spellings of the same country. (If you’re interested in the data or source-code, please contact me via email.) List manipulation and mathematical operations such as summation are very easy to do in the functional programming paradigm of Mathematica. Graphs are first-order data structures with numerous vertex and edge operators. Charting is also fairly powerful with BarCharts, ListPlots and more advanced graph charting options. Which other software provides all this flexibility in one integrated package?


    Posted by on October 6, 2011 in Recreational, Socioeconomic


    Tags: , , , ,

    Oregon Coast Bike Map

    Oregon Coast Bike Map

    A good example of visualization for recreational purposes is the Oregon Coast Bike Map created by the Oregon Department of Transportation and published here. Here is a sample page of this 13 page document:

    Sample Page from the Oregon Coast Bike Map

    The map is full of useful information relevant to cyclists such as weather, traffic, campgrounds, attractions, etc. What I find particularly useful is the indication of distances and elevation profile. Unlike motorized traffic hills tend to slow cyclists down a lot, so estimating ride time to a goal not only depends on the distance, but also on the vertical elevation gain en route to that goal. For example, consider this enlarged area (inset C of above page) of the beautiful “3 Capes” region near Tillamook:

    Inset of 3 Capes Region

    Note the use of color to indicate type of road and traffic as well as shaded bands in elevation profile. I think this is a good example of creating insight by visualizing data. I should know, as I was riding this stretch 2 years ago in August of 2009 during my Panamerican Peaks cycling and climbing adventure. Not having the benefit of such a detailed map I decided to embark on the 3 capes route late in the afternoon, only to get caught by sunset in NetArts as the unexpected hills slowed me down…

    Another excellent map also designed by ODOT is the Columbia River Gorge Bike Map. Check it out for another example of good visualization for recreational purposes.

    Leave a comment

    Posted by on August 30, 2011 in Recreational


    Tags: ,

    %d bloggers like this: