Where Will Your Country Stand in World War III?

In the recent Panama Papers scandal, journalists analyzed 11.5 million documents using network graphs to trace the use of offshore tax structures. In this chapter, we use a network graph technique called Social Network Analysis (SNA) to map weapons transfer between countries. By analyzing bilateral weapons trade, a network of multilateral ties can be distilled, providing insights into the complex arena of international politics.

SNA is based on mathematics and computer science concepts, and is applied in many social science disciplines. It analyzes relationships between individuals, uncovering social circles and influential people within a network. For instance, it can identify the main character in Game of Thrones, a popular television series. SNA is also used in government intelligence to map out crime rings and terrorist cells. Apart from people, other entities such as objects can be mapped in a network as well.

Introduction to Graphs

In SNA, network structures called graphs are used to analyze relationships between individuals. Each individual is represented by a node. A line called an edge between two nodes indicates a relationship between two individuals. These edges can have a value or weight that indicates the strength of the relationship.

In the graph below, David is acquainted with all three other individuals. Among his three acquaintances, Julia and Mary know each other, but they do not know Tom. As Julia has only just met David and Mary, their edges with Julia are weak.


A simple friendship network. The thickness of the edge denotes the level of relationship.

An Illustration

Data from the Stockholm International Peace Research Institute (SIPRI) has annual information on bilateral transfers of major conventional weapons. All prices are in US dollars using 1990 prices. Magnitude of arms transfer can be interpreted as a measure of bilateral relationship, since a country will only trust another with weapons if they are aligned on the international stage. As the value of arms trade between two countries can fluctuate based on when new technologies are available for sale, we looked at data from 2006 to 2015, and used the 10-year trade volume between countries as a measure of their relationship. Only 10-year trade volumes above $100 million are analyzed, and the resulting network graph contained 91 nodes and 295 edges.

The graph was generated using Gephi, and the network layout was determined using a force-directed algorithm. In this algorithm, nodes and edges are assigned “forces”. Nodes that have no edges between them repel each other, while nodes that do have connecting edges attract each other based on the strength of their connection.


A network showing the relations of countries based on weapons trade. Source: SIPRI

Interpreting the network

In the graph above, each node represents a country, and an edge exists between two countries if there is over $100 million worth of arms traded between them in the last 10 years. The size of the edges is proportional to the value of arms trade between two countries, the largest of which is between Russia and India ($22.3b), followed by Russia and China ($11.1b). Of the 295 edges, only 55 of them have values above $1 billion.

A node’s color denotes the subgroup of the country. The subgroups are discovered using the Louvain Method, which maximizes edges between countries in their own subgroup, and minimizes edges between countries of different subgroups. Since edges can be viewed as cordial relations between two countries, the subgroups can be viewed as alliances or alignments. Countries within the same subgroup are more likely to be singing the same tune in international politics, whereas countries of different subgroups are possibly against each other.

This algorithm has accurately placed US in a different group from Russia and China, and the largest group (blue) contains the US and many of her key allies. The countries that surround US in the network are her strategic partners across the world that she counts on to maintain her power against her rivals. The second group (yellow) comprises mostly European nations, but also contains countries friendly to the West which are grouped separately from the blue group because their key arms trading partner is Germany, Netherlands, or Sweden, instead of the US.

The last group (red) comprises states which have closer relations to Russia or China, and are mostly from Asia and Africa. Many of these countries have government types which are incompatible with the US, and are often criticized by the West for their human rights records or their lack of democracy. The most surprising inclusion in this group is Ukraine, which has seemingly unstable relations with Russia due to Russia’s military intervention in Ukraine in 2014. Ukraine’s placement is due to her arms trade with many countries in her subgroup such as Russia and China, as well as her lack of interactions with Western nations. In fact, according SIPRI, Ukraine exported US$227m worth of arms to Russia in 2014 and 2015, despite Russia’s military operating in their country during this period.

How influential is a country?

The size of each country’s node represents its centrality in the network, and is determined using the PageRank algorithm. This algorithm, named after Google founder Larry Page, was used by an initial version of Google to rank websites. In our network, PageRank determines a country’s centrality by the number of connections it has, the strength of its connections, as well as the importance of the countries it is connected to. Thus, centrality can be seen as a country’s influence on the global stage.


Unsurprisingly, PageRank ranked the US as the most influential country in the network. Despite Russia’s involvement in the two largest bilateral arms transfer, it is the US that tops total arms transfer value over the last 10 years. The US traded $92.5b worth of arms with her allies, including South Korea ($8.12b), United Arab Emirates ($6.98b), Australia ($6.21b), and Saudi Arabia ($5.69b). In total, the US conducted arms trade valued above $1 billion with 22 other countries in this period.

Despite India having the third largest total trade volume, it is ranked a distant 14th by PageRank, due to having fewer links. Instead, the algorithm identified US, Russia, Germany, France, and China in its top five, which again demonstrates the accuracy of the algorithm since four of them wield significant power as permanent members of the United Nations Security Council.

A surprise inclusion in the top 15 is Ukraine (6th), since she is not known to be an influential country. This demonstrates the limitations of using just the SIPRI data to analyze international relations. Ukraine’s position is inflated because of her major arms export industry, as she was the 10th largest exporter from 2006-2015. She shipped weapons to 15 different countries in this network, of which 5 of them import exclusively from her.

Did you learn something useful today? We would be glad to inform you when we have new tutorials, so that your learning continues!

Sign up below to get bite-sized tutorials delivered to your inbox:


Free Data Science Tutorials

Copyright © 2015-Present Algobeans.com. All rights reserved. Be a cool bean.

13 thoughts on “Where Will Your Country Stand in World War III?

  1. Adrian Chia says:

    Is the value of the arms trade summed up over the last 10 years? It would be nice if the model can track the changes over time over discrete time points, e.g. yearly or 3-yearly (depending on what is a good length of time that is relevant for arms purchases). Then one can see the changing relationships between states over time 🙂


  2. naveenishere says:

    Great analysis.. Very interesting.. Could you please list any other similar techniques other than SNA that could help perform similar analysis? Just want to know what they are and understand their pros and cons compared to SNA.

    Liked by 1 person

    • Kenneth Soo says:

      Hi Naveen, a variation on our network graph is having directed edges, useful if there’s a meaningful difference between imports and exports (which we didn’t thought there was). There are also many ways to analyse a network other than centrality and subgroups. For example, one might be concerned about the average degree of separation when analyzing a terrorist cell, in order to understand how developed is the cell. Even for measuring centrality itself, there are many different methods, each suited to different data.

      Liked by 1 person

  3. pang says:

    An interesting essay! It makes me confused that whether we can use cluster alogrithm to get some subgroups, if we can, how should we preprocess the data?


    • Kenneth Soo says:

      Hi, the Louvain algorithm can be used to find the subgroups. Once you have your data in Gephi, you can find the subgroups in your network automatically using the clustering tool in Gephi.


      • simon says:

        hello, could you provide us the data used in this excellent post, or give us the url to download the data, thanks , my email :dataminingr@gmail.com


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s