Interpretive Assignment

Interpretive Assignment
Interpretive Assignment
Author

Akhilesh Kumar

Published

May 25, 2023

Code
library(igraph)

Attaching package: 'igraph'
The following objects are masked from 'package:stats':

    decompose, spectrum
The following object is masked from 'package:base':

    union
Code
library(network)
Warning: package 'network' was built under R version 4.2.3

'network' 1.18.1 (2023-01-24), part of the Statnet Project
* 'news(package="network")' for changes since last version
* 'citation("network")' for citation information
* 'https://statnet.org' for help, support, and other information

Attaching package: 'network'
The following objects are masked from 'package:igraph':

    %c%, %s%, add.edges, add.vertices, delete.edges, delete.vertices,
    get.edge.attribute, get.edges, get.vertex.attribute, is.bipartite,
    is.directed, list.edge.attributes, list.vertex.attributes,
    set.edge.attribute, set.vertex.attribute
Code
library(dplyr)

Attaching package: 'dplyr'
The following objects are masked from 'package:igraph':

    as_data_frame, groups, union
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union

Introduction

The crude oil international trade network dataset downloaded from the ITC website for the year 2022 is a matrix-format dataset capturing the import and export activities of crude oil between countries. The data is directed, representing the flow of crude oil from exporting to importing countries, and it is weighted, with the unit value expressed in 1000 dollars. This dataset provides valuable insights into the global crude oil trade dynamics, allowing for the identification of major importers, exporters, trade imbalances, and potential trade relationships. By analyzing the matrix, it is possible to gain a comprehensive understanding of the magnitude and patterns of crude oil trade on an international scale, aiding in strategic decision-making and market analysis within the crude oil industry.

Read Data

Code
 data <- read.csv("C:/social network project/project data/2709/Merged/2022.csv", header = TRUE, row.names = 1)

adjacency_matrix <- as.matrix(data)

ig.net <- igraph::graph_from_adjacency_matrix(adjacency_matrix, mode = "directed", weighted = TRUE, diag = FALSE)

Network Attribute

Node Count: The network consists of 241 nodes or countries. These nodes represent the entities involved in the crude international trade.

Edge Count: The network has 917 edges, which represent the connections or relationships between the countries in terms of crude international trade. Each edge represents a trade relationship between two countries.

is_bipartite: The network is determined to be not bipartite. A bipartite network is one where the nodes can be divided into two non-overlapping sets, and all edges connect nodes from one set to the other. In this case, the network does not exhibit such a clear division.

is_directed: The network is directed, as indicated by the “TRUE” value. Directed edges mean that the relationships between countries in terms of crude international trade have a specific direction. It implies that the trade flow or influence between countries is not symmetric.

is_weighted: The network is weighted, as indicated by the “TRUE” value. the weights represent value of international trade of crude oil between countries, and the unit is 1000 dollar,

is_connected: The network is determined to be not connected. It implies that there may be some countries that are not directly connected or involved in the crude oil trade network, or there are isolated subnetworks within the overall trade network.

Diameter: The diameter of the network is determined to be 1,750,920. The diameter is a measure of the longest shortest path between any two nodes in the network. In this case, it indicates that the maximum number of steps required to reach any country from any other country in terms of crude international trade is 1,750,920 steps. This value represents the maximum distance or connectivity in the network.

Average Path Length: The average path length of the network is calculated to be 68,350.95. The average path length is the average number of steps required to reach any country from any other country in the network. It provides an overall measure of the network’s connectivity and how efficiently information or trade flows between countries.

Components: The components object contains three elements: membership, csize, and no. The membership element assigns each node (country) to a specific component. The csize element specifies the size of each component, and the no element indicates the number of components in the network.

Number of Components: There is only one component in the network, as indicated by the value 1 in the num_components variable. This means that all countries in the network are connected in some way, either directly or indirectly through other countries, forming a single connected component.

Component Sizes: The component_sizes variable contains a vector that indicates the size of each component. In this case, all components have a size of 1, except for one component that has a size of 146. This implies that the majority of countries are part of a single large connected component, while the remaining countries form isolated components of size 1.

Giant Component Proportion: The giant_component_proportion variable represents the proportion of nodes in the giant component, which is the largest connected component in the network. The result is approximately 0.6058091, indicating that around 60.58% of the nodes are part of the giant component.

Singleton Proportion: The singleton_proportion variable represents the proportion of unconnected nodes or singletons in the network. The result is approximately 0.3941909, indicating that around 39.42% of the nodes in the network are not connected to any other node.

The vertex attribute names in the network are:

  • “name”: This attribute represents the name or label of each vertex in the network. It likely corresponds to the names of the countries involved in the crude international trade.

  • “in_weight”: This attribute represents the weight or quantitative measure associated with the incoming edges of each vertex. It likely indicates the amount of crude oil received by each country from other countries.

  • “out_weight”: This attribute represents the weight or quantitative measure associated with the outgoing edges of each vertex. It likely indicates the amount of crude oil exported by each country to other countries.

The edge attribute for the network is “weight”, as indicated by the result, which is value of trade with per unit value of $1000.

Minimum Edge Weight: The minimum edge weight in the network is 1. This represents the lowest value among all the edge weights in the crude international trade network.

Mean Edge Weight: The mean edge weight in the network is approximately 1,584,591, with per unit value of $1000.

Median Edge Weight: The median edge weight in the network is approximately 113,854, with per unit value of $1000.

Density: The density of the network is approximately 0.01585408. Density is a measure of how interconnected the network is. It represents the proportion of edges present in the network compared to the maximum possible number of edges. 0.01585408 suggests low density network.

Code
  # Number of vertices in network:
  cat("Node Count: \n")
Node Count: 
Code
  nodes = vcount(ig.net)
  print(nodes)
[1] 241
Code
  # Number of edges in network:
  cat("Edge Count: \n")
Edge Count: 
Code
  ecount(ig.net)
[1] 917
Code
  # Bipartite or single mode network verification in network:
  cat("is_bipartite: \n")
is_bipartite: 
Code
  is_bipartite(ig.net)
[1] FALSE
Code
  # Directed or undirected edges verification in network
  cat("is_directed: \n")
is_directed: 
Code
  print(is_directed(ig.net))
[1] TRUE
Code
  # Weighted or unweighted edges verification in network
  cat("is_weighted \n")
is_weighted 
Code
  print(is_weighted(ig.net))
[1] TRUE
Code
  # Is Connected verification in network
  cat("is_connected: \n")
is_connected: 
Code
  print(is_connected(ig.net))
[1] FALSE
Code
  # Calculate the diameter of the network
  cat("diameter \n")
diameter 
Code
  diameter <- diameter(ig.net)
  print(diameter)
[1] 1750920
Code
  # Calculate the average path length
  cat("average_path_length: \n")
average_path_length: 
Code
  average_path_length <- average.path.length(ig.net)
  print(average_path_length)
[1] 68350.95
Code
   # Calculate the connected components
  cat("Components: \n")
Components: 
Code
  components <- clusters(ig.net)
  print(components)
$membership
                              Afghanistan 
                                        1 
                               Africa_nes 
                                        2 
                                  Albania 
                                        3 
                                  Algeria 
                                        3 
                              America_nes 
                                        4 
                           American_Samoa 
                                        5 
                                  Andorra 
                                        3 
                                   Angola 
                                        3 
                                 Anguilla 
                                        6 
                      Antigua_and_Barbuda 
                                        7 
                                 Area_Nes 
                                        3 
                                Argentina 
                                        3 
                                  Armenia 
                                        8 
                                    Aruba 
                                        3 
                                 Asia_nes 
                                        9 
                                Australia 
                                        3 
                                  Austria 
                                        3 
                               Azerbaijan 
                                        3 
                                  Bahamas 
                                        3 
                                  Bahrain 
                                        3 
                               Bangladesh 
                                        3 
                                 Barbados 
                                        3 
                                  Belarus 
                                       10 
                                  Belgium 
                                        3 
                                   Belize 
                                        3 
                                    Benin 
                                       11 
                                  Bermuda 
                                       12 
                                   Bhutan 
                                       13 
                                  Bolivia 
                                        3 
          Bonaire_Sint_Eustatius_and_Saba 
                                       14 
                   Bosnia_and_Herzegovina 
                                        3 
                                 Botswana 
                                        3 
                                   Brazil 
                                        3 
           British_Indian_Ocean_Territory 
                                       15 
                   British_Virgin_Islands 
                                       16 
                        Brunei_Darussalam 
                                        3 
                                 Bulgaria 
                                        3 
                             Burkina_Faso 
                                       17 
                                  Burundi 
                                       18 
                               Cabo_Verde 
                                       19 
                                 Cambodia 
                                        3 
                                 Cameroon 
                                        3 
                                   Canada 
                                        3 
                            Caribbean_Nes 
                                       20 
                           Cayman_Islands 
                                       21 
                 Central_African_Republic 
                                       22 
                                     Chad 
                                        3 
                                    Chile 
                                        3 
                                    China 
                                        3 
                         Christmas_Island 
                                       23 
                  Cocos_.Keeling._Islands 
                                       24 
                                 Colombia 
                                        3 
                                  Comoros 
                                       25 
                                    Congo 
                                        3 
                                 Congo_DR 
                                        3 
                             Cook_Islands 
                                       26 
                               Costa_Rica 
                                       27 
                                  Croatia 
                                        3 
                                     Cuba 
                                        3 
                                  Curacao 
                                        3 
                                   Cyprus 
                                        3 
                           Czech_Republic 
                                        3 
                                  Denmark 
                                        3 
                                 Djibouti 
                                       28 
                                 Dominica 
                                        3 
                       Dominican_Republic 
                                        3 
                                  Ecuador 
                                        3 
                                    Egypt 
                                        3 
                              El_Salvador 
                                        3 
                        Equatorial_Guinea 
                                        3 
                                  Eritrea 
                                       29 
                                  Estonia 
                                        3 
                                 Eswatini 
                                       30 
                                 Ethiopia 
                                        3 
                         Europe_Othr._Nes 
                                       31 
                       European_Union_Nes 
                                        3 
              Falkland_Islands_.Malvinas. 
                                       32 
                            Faroe_Islands 
                                       33 
                                     Fiji 
                                       34 
                                  Finland 
                                        3 
                                   France 
                                        3 
                               Free_Zones 
                                       35 
                         French_Polynesia 
                                       36 
French_Southern_and_Antarctic_Territories 
                                       37 
                                    Gabon 
                                        3 
                                   Gambia 
                                       38 
                                  Georgia 
                                        3 
                                  Germany 
                                        3 
                                    Ghana 
                                        3 
                                Gibraltar 
                                        3 
                                   Greece 
                                        3 
                                Greenland 
                                        3 
                                  Grenada 
                                       39 
                                Guatemala 
                                        3 
                                   Guinea 
                                       40 
                            Guinea.Bissau 
                                       41 
                                   Guyana 
                                        3 
                                    Haiti 
                                       42 
                                 Honduras 
                                       43 
                                 Hongkong 
                                        3 
                                  Hungary 
                                        3 
                                  Iceland 
                                        3 
                                    India 
                                        3 
                                Indonesia 
                                        3 
                                     Iran 
                                        3 
                                     Iraq 
                                        3 
                                  Ireland 
                                        3 
                                   Israel 
                                        3 
                                    Italy 
                                        3 
                              Ivory_Coast 
                                        3 
                                  Jamaica 
                                        3 
                                    Japan 
                                        3 
                                   Jordan 
                                       44 
                               Kazakhstan 
                                        3 
                                    Kenya 
                                        3 
                                 Kiribati 
                                       45 
                                   Kuwait 
                                        3 
                               Kyrgyzstan 
                                       46 
                                 LAIA_nes 
                                       47 
                                     Laos 
                                       48 
                                     Laso 
                                       49 
                                   Latvia 
                                        3 
                                  Lebanon 
                                       50 
                                  Lesotho 
                                        3 
                                  Liberia 
                                        3 
                                    Libya 
                                        3 
                                Lithuania 
                                        3 
                               Luxembourg 
                                        3 
                                Macedonia 
                                       51 
                               Madagascar 
                                        3 
                                   Malawi 
                                        3 
                                 Malaysia 
                                        3 
                                 Maldives 
                                       52 
                                     Mali 
                                        3 
                                    Malta 
                                        3 
                         Marshall_Islands 
                                       53 
                               Mauritania 
                                       54 
                                Mauritius 
                                       55 
                                  Mayotte 
                                       56 
                                   Mexico 
                                        3 
                               Micronesia 
                                       57 
                                  Moldova 
                                        3 
                                 Mongolia 
                                        3 
                               Montenegro 
                                       58 
                               Montserrat 
                                       59 
                                  Morocco 
                                        3 
                               Mozambique 
                                        3 
                                  Myanmar 
                                        3 
                                  Namibia 
                                        3 
                                    Nauru 
                                       60 
                                    Nepal 
                                       61 
                              Netherlands 
                                        3 
                     Netherlands_Antilles 
                                       62 
                            New_Caledonia 
                                       63 
                              New_Zealand 
                                        3 
                                Nicaragua 
                                        3 
                                    Niger 
                                        3 
                                  Nigeria 
                                        3 
                                     Niue 
                                       64 
                           Norfolk_Island 
                                       65 
    North_America_and_Central_America_nes 
                                       66 
                              North_Korea 
                                       67 
                 Northern_Mariana_Islands 
                                       68 
                                   Norway 
                                        3 
                              Oceania_Nes 
                                       69 
                                     Oman 
                                        3 
                                 Pakistan 
                                        3 
                                    Palau 
                                       70 
                                Palestine 
                                       71 
                                   Panama 
                                        3 
                         Papua_New_Guinea 
                                        3 
                                 Paraguay 
                                        3 
                                     Peru 
                                        3 
                              Philippines 
                                        3 
                                 Pitcairn 
                                       72 
                                   Poland 
                                        3 
                                 Portugal 
                                        3 
                                    Qatar 
                                        3 
                                  Romania 
                                        3 
                                   Russia 
                                        3 
                                   Rwanda 
                                       73 
                             Saint_Helena 
                                        3 
                    Saint_Kitts_and_Nevis 
                                       74 
                              Saint_Lucia 
                                       75 
                Saint_Pierre_and_Miquelon 
                                       76 
         Saint_Vincent_and_the_Grenadines 
                                       77 
                                    Samoa 
                                       78 
                    Sao_Tome_and_Principe 
                                       79 
                             Saudi_Arabia 
                                        3 
                                  Senegal 
                                        3 
                                   Serbia 
                                        3 
                    Serbia_and_Montenegro 
                                       80 
                               Seychelles 
                                       81 
                  Ship_stores_and_bunkers 
                                        3 
                             Sierra_Leone 
                                        3 
                                Singapore 
                                        3 
                                 Slovakia 
                                        3 
                                 Slovenia 
                                        3 
                          Solomon_Islands 
                                       82 
                                  Somalia 
                                       83 
                             South_Africa 
                                        3 
                              South_Korea 
                                        3 
                              South_Sudan 
                                        3 
                                    Spain 
                                        3 
                       Special_categories 
                                        3 
                                Sri_Lanka 
                                       84 
                                    Sudan 
                                        3 
                                 Suriname 
                                        3 
                                   Sweden 
                                        3 
                              Switzerland 
                                        3 
                                    Syria 
                                       85 
                           Taipei_Chinese 
                                        3 
                               Tajikistan 
                                       86 
                                 Tanzania 
                                       87 
                                 Thailand 
                                        3 
                              Timor.Leste 
                                        3 
                                     Togo 
                                        3 
                                  Tokelau 
                                       88 
                                    Tonga 
                                       89 
                      Trinidad_and_Tobago 
                                        3 
                                  Tunisia 
                                        3 
                                   Turkey 
                                        3 
                             Turkmenistan 
                                        3 
                 Turks_and_Caicos_Islands 
                                       90 
                                   Tuvalu 
                                       91 
                                   Uganda 
                                       92 
                                  Ukraine 
                                        3 
                     United_Arab_Emirates 
                                        3 
                           United_Kingdom 
                                        3 
     United_States_Minor_Outlying_Islands 
                                        3 
                 United_States_of_America 
                                        3 
                                  Uruguay 
                                        3 
                               Uzbekistan 
                                       93 
                                  Vanuatu 
                                       94 
                                Venezuela 
                                        3 
                                 Viet_Nam 
                                        3 
                Wallis_and_Futuna_Islands 
                                       95 
                            West_Asia_nes 
                                       96 
                                    Yemen 
                                        3 
                                   Zambia 
                                        3 
                                 Zimbabwe 
                                        3 

$csize
 [1]   1   1 146   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
[20]   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
[39]   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
[58]   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
[77]   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
[96]   1

$no
[1] 96
Code
  cat("Number of Components")
Number of Components
Code
  num_components <- length(components$no)
  print(num_components)
[1] 1
Code
  cat("Component_Size")
Component_Size
Code
  component_sizes <- components$csize
  print(component_sizes)
 [1]   1   1 146   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
[20]   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
[39]   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
[58]   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
[77]   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1
[96]   1
Code
  # Calculate the proportion of nodes in the giant component
  cat("giant_component_proportion: \n")
giant_component_proportion: 
Code
  giant_component_proportion <- max(components$csize) / nodes
  print(giant_component_proportion)
[1] 0.6058091
Code
  # Calculate the proportion of unconnected nodes (singletons)
  
  cat("Singlton: \n")
Singlton: 
Code
  singleton_proportion <- sum(components$csize == 1) / nodes
  print(singleton_proportion)
[1] 0.3941909
Code
  # Vertex attributes for network
  cat("vertex_attr_names: \n")
vertex_attr_names: 
Code
  print(vertex_attr_names(ig.net))
[1] "name"
Code
  # Vertex attribute, Nodes in network:
  cat("Node Names: \n")
Node Names: 
Code
  print(V(ig.net)$name)
  [1] "Afghanistan"                              
  [2] "Africa_nes"                               
  [3] "Albania"                                  
  [4] "Algeria"                                  
  [5] "America_nes"                              
  [6] "American_Samoa"                           
  [7] "Andorra"                                  
  [8] "Angola"                                   
  [9] "Anguilla"                                 
 [10] "Antigua_and_Barbuda"                      
 [11] "Area_Nes"                                 
 [12] "Argentina"                                
 [13] "Armenia"                                  
 [14] "Aruba"                                    
 [15] "Asia_nes"                                 
 [16] "Australia"                                
 [17] "Austria"                                  
 [18] "Azerbaijan"                               
 [19] "Bahamas"                                  
 [20] "Bahrain"                                  
 [21] "Bangladesh"                               
 [22] "Barbados"                                 
 [23] "Belarus"                                  
 [24] "Belgium"                                  
 [25] "Belize"                                   
 [26] "Benin"                                    
 [27] "Bermuda"                                  
 [28] "Bhutan"                                   
 [29] "Bolivia"                                  
 [30] "Bonaire_Sint_Eustatius_and_Saba"          
 [31] "Bosnia_and_Herzegovina"                   
 [32] "Botswana"                                 
 [33] "Brazil"                                   
 [34] "British_Indian_Ocean_Territory"           
 [35] "British_Virgin_Islands"                   
 [36] "Brunei_Darussalam"                        
 [37] "Bulgaria"                                 
 [38] "Burkina_Faso"                             
 [39] "Burundi"                                  
 [40] "Cabo_Verde"                               
 [41] "Cambodia"                                 
 [42] "Cameroon"                                 
 [43] "Canada"                                   
 [44] "Caribbean_Nes"                            
 [45] "Cayman_Islands"                           
 [46] "Central_African_Republic"                 
 [47] "Chad"                                     
 [48] "Chile"                                    
 [49] "China"                                    
 [50] "Christmas_Island"                         
 [51] "Cocos_.Keeling._Islands"                  
 [52] "Colombia"                                 
 [53] "Comoros"                                  
 [54] "Congo"                                    
 [55] "Congo_DR"                                 
 [56] "Cook_Islands"                             
 [57] "Costa_Rica"                               
 [58] "Croatia"                                  
 [59] "Cuba"                                     
 [60] "Curacao"                                  
 [61] "Cyprus"                                   
 [62] "Czech_Republic"                           
 [63] "Denmark"                                  
 [64] "Djibouti"                                 
 [65] "Dominica"                                 
 [66] "Dominican_Republic"                       
 [67] "Ecuador"                                  
 [68] "Egypt"                                    
 [69] "El_Salvador"                              
 [70] "Equatorial_Guinea"                        
 [71] "Eritrea"                                  
 [72] "Estonia"                                  
 [73] "Eswatini"                                 
 [74] "Ethiopia"                                 
 [75] "Europe_Othr._Nes"                         
 [76] "European_Union_Nes"                       
 [77] "Falkland_Islands_.Malvinas."              
 [78] "Faroe_Islands"                            
 [79] "Fiji"                                     
 [80] "Finland"                                  
 [81] "France"                                   
 [82] "Free_Zones"                               
 [83] "French_Polynesia"                         
 [84] "French_Southern_and_Antarctic_Territories"
 [85] "Gabon"                                    
 [86] "Gambia"                                   
 [87] "Georgia"                                  
 [88] "Germany"                                  
 [89] "Ghana"                                    
 [90] "Gibraltar"                                
 [91] "Greece"                                   
 [92] "Greenland"                                
 [93] "Grenada"                                  
 [94] "Guatemala"                                
 [95] "Guinea"                                   
 [96] "Guinea.Bissau"                            
 [97] "Guyana"                                   
 [98] "Haiti"                                    
 [99] "Honduras"                                 
[100] "Hongkong"                                 
[101] "Hungary"                                  
[102] "Iceland"                                  
[103] "India"                                    
[104] "Indonesia"                                
[105] "Iran"                                     
[106] "Iraq"                                     
[107] "Ireland"                                  
[108] "Israel"                                   
[109] "Italy"                                    
[110] "Ivory_Coast"                              
[111] "Jamaica"                                  
[112] "Japan"                                    
[113] "Jordan"                                   
[114] "Kazakhstan"                               
[115] "Kenya"                                    
[116] "Kiribati"                                 
[117] "Kuwait"                                   
[118] "Kyrgyzstan"                               
[119] "LAIA_nes"                                 
[120] "Laos"                                     
[121] "Laso"                                     
[122] "Latvia"                                   
[123] "Lebanon"                                  
[124] "Lesotho"                                  
[125] "Liberia"                                  
[126] "Libya"                                    
[127] "Lithuania"                                
[128] "Luxembourg"                               
[129] "Macedonia"                                
[130] "Madagascar"                               
[131] "Malawi"                                   
[132] "Malaysia"                                 
[133] "Maldives"                                 
[134] "Mali"                                     
[135] "Malta"                                    
[136] "Marshall_Islands"                         
[137] "Mauritania"                               
[138] "Mauritius"                                
[139] "Mayotte"                                  
[140] "Mexico"                                   
[141] "Micronesia"                               
[142] "Moldova"                                  
[143] "Mongolia"                                 
[144] "Montenegro"                               
[145] "Montserrat"                               
[146] "Morocco"                                  
[147] "Mozambique"                               
[148] "Myanmar"                                  
[149] "Namibia"                                  
[150] "Nauru"                                    
[151] "Nepal"                                    
[152] "Netherlands"                              
[153] "Netherlands_Antilles"                     
[154] "New_Caledonia"                            
[155] "New_Zealand"                              
[156] "Nicaragua"                                
[157] "Niger"                                    
[158] "Nigeria"                                  
[159] "Niue"                                     
[160] "Norfolk_Island"                           
[161] "North_America_and_Central_America_nes"    
[162] "North_Korea"                              
[163] "Northern_Mariana_Islands"                 
[164] "Norway"                                   
[165] "Oceania_Nes"                              
[166] "Oman"                                     
[167] "Pakistan"                                 
[168] "Palau"                                    
[169] "Palestine"                                
[170] "Panama"                                   
[171] "Papua_New_Guinea"                         
[172] "Paraguay"                                 
[173] "Peru"                                     
[174] "Philippines"                              
[175] "Pitcairn"                                 
[176] "Poland"                                   
[177] "Portugal"                                 
[178] "Qatar"                                    
[179] "Romania"                                  
[180] "Russia"                                   
[181] "Rwanda"                                   
[182] "Saint_Helena"                             
[183] "Saint_Kitts_and_Nevis"                    
[184] "Saint_Lucia"                              
[185] "Saint_Pierre_and_Miquelon"                
[186] "Saint_Vincent_and_the_Grenadines"         
[187] "Samoa"                                    
[188] "Sao_Tome_and_Principe"                    
[189] "Saudi_Arabia"                             
[190] "Senegal"                                  
[191] "Serbia"                                   
[192] "Serbia_and_Montenegro"                    
[193] "Seychelles"                               
[194] "Ship_stores_and_bunkers"                  
[195] "Sierra_Leone"                             
[196] "Singapore"                                
[197] "Slovakia"                                 
[198] "Slovenia"                                 
[199] "Solomon_Islands"                          
[200] "Somalia"                                  
[201] "South_Africa"                             
[202] "South_Korea"                              
[203] "South_Sudan"                              
[204] "Spain"                                    
[205] "Special_categories"                       
[206] "Sri_Lanka"                                
[207] "Sudan"                                    
[208] "Suriname"                                 
[209] "Sweden"                                   
[210] "Switzerland"                              
[211] "Syria"                                    
[212] "Taipei_Chinese"                           
[213] "Tajikistan"                               
[214] "Tanzania"                                 
[215] "Thailand"                                 
[216] "Timor.Leste"                              
[217] "Togo"                                     
[218] "Tokelau"                                  
[219] "Tonga"                                    
[220] "Trinidad_and_Tobago"                      
[221] "Tunisia"                                  
[222] "Turkey"                                   
[223] "Turkmenistan"                             
[224] "Turks_and_Caicos_Islands"                 
[225] "Tuvalu"                                   
[226] "Uganda"                                   
[227] "Ukraine"                                  
[228] "United_Arab_Emirates"                     
[229] "United_Kingdom"                           
[230] "United_States_Minor_Outlying_Islands"     
[231] "United_States_of_America"                 
[232] "Uruguay"                                  
[233] "Uzbekistan"                               
[234] "Vanuatu"                                  
[235] "Venezuela"                                
[236] "Viet_Nam"                                 
[237] "Wallis_and_Futuna_Islands"                
[238] "West_Asia_nes"                            
[239] "Yemen"                                    
[240] "Zambia"                                   
[241] "Zimbabwe"                                 
Code
  # Edge attributes for network:
  cat("Edge Attribute \n")
Edge Attribute 
Code
  print(edge_attr_names(ig.net))
[1] "weight"
Code
  # Edge attribute, Edges with weights in network:
  
  cat("Edge Weight \n")
Edge Weight 
Code
  print(E(ig.net)$weight)
  [1]     12478    305004    247026    302042   1094091    580637    167086
  [8]   2873409   1095890    336217    401433   1202916     58094    130703
 [15]     52926   1845148    906989    159260    827905   2696792    103106
 [22]    449284   1356213    615177     32022     30318    507192     45549
 [29]    426260  22567161   2344323    108847    837639   1475558    118270
 [36]     91286   1898373    624618    297678    444347   1613939     17763
 [43]    968936   1885710    511565   1388874    677582   9751714       554
 [50]    423613    120441     80453    285242     43981         1     89379
 [57]   2204065     44153  10110530   1542035    569761    251902    278686
 [64]        65   1751801   2149031     52554   1536401     91128     11741
 [71]        25    230910     40020    131124   1217519   1456515    399133
 [78]   1779185    419543    839911    426715   7285145     16254     63262
 [85]    876148    538876   1473440    157243    233779    518854    403852
 [92]         1    423857     13355        22      1006         1     11399
 [99]         2    991855     16185      1173       396      5387         1
[106]   4038703  18621482     73534         1    558936    114892   1847667
[113]   1067946    264846    268517     25733   1085363   2693853     54037
[120]         1    934574   2834469   2329024   2448930   3925967     60042
[127]     66328         1     26116   5620105    345764   1098769     65992
[134]     82676     83690    270472     67815    314748      3231         6
[141]     33506    274409    477227    279639    829569     31590    305992
[148]     71635        53   2670783         3    146598    479634     86108
[155]     72161    110365    612260     71279    219333   1306562   1224719
[162] 117856834   1078418    402746   1230042    444267    514249     20528
[169]      5313     11039         1         6         4    508347    295164
[176]         1    177277    331725     33357     92233    107830     92592
[183]     39232    230389    318457     10624   5759014       977   1856333
[190]    201447    421884     77604         5   5228003    585559   8163115
[197]    446387   5153689    250250    197777    218556    217785     89856
[204]     97656    130245    100605    153045    653934    259528         2
[211]    395416         4         1      6632         1        41         1
[218]         5        48        23     78256    125433        13         1
[225]    289489         6     75931     26815         8     14297        32
[232]         1    137694    978986   1400175      4044   1794186    452979
[239]    112510         1   5267022    124505    105828    180201    808155
[246]    161138         1     75283    109513   1061143    206037    341959
[253]    162648    287495    119784    314531    884936     62533         3
[260]        10      2251       343     20115      1029      1083     15778
[267]      2918        16         2      1731    138094         3         2
[274]        15      3405         1         1       409         3         1
[281]      3965        11         6         2         5   2413278    142568
[288]    103726    447085    564018    334619    330576    122788     29363
[295]    705506    109962    179604    116617      1518      8485         3
[302]        42         3       401        18    125117      4446        88
[309]   1704766     92174    383598    112461    117861    114057    101814
[316]    586440   2361456     92972    302919      7021         7     11779
[323]     14686     81401    237654    565300   1265754     33130   1071646
[330]     96613    372382   1473226     92595    504249    812657   2677127
[337]         1        25        92     83726        87        18      2188
[344]    160858    448830     26330     40392     63167     92034     16555
[351]   1372918         1    560630    595979    109591  39093287   1554344
[358]   1929780   6967447   5328790     82908   4772873    362645   1210594
[365]    876169   8520840   3442000    512079         1   7874649     45401
[372]        16        80    327216      5500         1         1         2
[379]         6     30165     45954     12007        98       767         3
[386]         2     30380       434    684940     34643      3366    196017
[393]    154772     59620     43064     70659    113812         1      8895
[400]       141     80639   1676963   4636197    148780    463611      5601
[407]       266   4333606   6418960   2602604    228681   2986517     98203
[414]    416649     86181    367912   3168910    151327   4589847   2483481
[421]    335210     40865    625200    882818  24602783         1   8293658
[428]    585400     12758  10728438   6388448    415100    892822      1122
[435]       804         2      2221       169      9004         2    388291
[442]    771639   2933334    121827    251287   2235536   3718084   2476304
[449]   6853679     36354   2085288    114081    277850   3820278    337489
[456]    116399   1959664   1582249   2237086        11     17229     61661
[463]         2   2525233     56868   1043353  21740572   1185778     20434
[470]   1043512         2         1       198    173739    552574     67573
[477]   2323240         1    127854     71828    408574   3860052   3770179
[484]  21163289       950    243492         2     55391     22044         1
[491]         1         4  23250286        13         1         1         1
[498]         7        31         2        10       101   7084382         1
[505]         2         9        36         1         4         1        13
[512]         2         1     17793         1         1    147472        11
[519]         1     15746    213601    129758     66136      8498         1
[526]    250476     17430         1     53910     32747         2    270318
[533]    193916   1186348   1278199    340079   4204934   1735372     13200
[540]   4198999   1596186   5010700    326074    209380   1101807    428947
[547]    246183   2164577   1090617   6769654   1472697    747307    204119
[554]    920506   1373720   4036198    299680     10346    651630   4545038
[561]         2    946837   5090845   1787993   7576264    144848    102774
[568]     84450     64065    705056    996041  10373570   2954453     80396
[575]     58714    336835    662596   9265758    221249     56577  18123908
[582]    575668  29157746   1202890    108261         2     44429    413453
[589]   2025875    252664     52890    202504      1287    352673     30337
[596]     84573     67133     60330    105772    259031    261413     55685
[603]     13844    221547         4    110382         2       112       205
[610]         1        14        12   5975564        17   7083052    352808
[617]        74   3396585   4887369    307048   1223436        20        43
[624]    267882        27     29557    236845     68061      5011   3421321
[631]  58377524     82848   2290117     74828   1076117   1776107       475
[638]  12641283    258279   2711426   7184273   1425354    753569    204592
[645]  14905784   6542554   1439438   1054516    101725   2819373   2314472
[652]    428932    223676    291718    546749    521647   3205478   2783010
[659]  64971515    168538   2615960    859020   1511868     64327   3129554
[666]   3039470  39706650   2209040   6328607   6226721   5233727     56367
[673]   4059218   1564543  37662458   3566291  10227749   5247494    110622
[680]  16598971      2104       294     26102        68     57722         3
[687]         9    104084         1      7724        12        10         3
[694]         5       119         2      1497         1         7        46
[701]        18        23        15         5         4        10        10
[708]       276         1         2     48301         3        36         1
[715]        12         2     94841         1     52141         2         2
[722]        15     19887         6         3    236968    139117     42715
[729]         1         7        10       130        14         7         6
[736]         6    412442         7    124855         4      6297        86
[743]         9        79     23606      8475        10         3        10
[750]         1     48346       185     34119     61297    420769     55821
[757]    157471     13884        10         1         2        47        13
[764]     11675       195         1         1         1         2    147665
[771]    341480     46121    144705     21258     16823     66351     39253
[778]     22969         4     64285    107015         5    131629     81491
[785]    239097     82167   1565406     20351         1     19374     63190
[792]     96874     16441    104961     32102    113854     24289    123422
[799]     66869     62390     56687     49730     76746     80599    384577
[806]         7     47365       287     28995      8075     61096       299
[813]        63    238566  32246641       160    428319    205348     31746
[820]    216825  37738082   1947939    574062    563671   9492058   9224971
[827]    284940   2600806  14870569    462932    156362    187354         3
[834]     71832   1714953         2         2    322861    692826   1449069
[841]   4453724         1    182217    560733   1136405   9103259     69597
[848]     52778   1368172         1    503848   1024198    852203   2274709
[855]         1         2         1   1749763         1    978318    102218
[862]     92431   3000895  11912003    183275   6971488    762749         1
[869]    405484   1868128     28500    717941    430213   6251864   8553791
[876]  10135076    294475   1600251   5194005   1052993    551805    168720
[883]  12334243    155293    889513    682759     42250    799297   1013025
[890]    356919   9937698         1  14020887   5784117   1346488    760341
[897]   6621819   3108906  11444088   1312708     92500         1     94370
[904]     46491     65798    490338    508348    206897    379472    131022
[911]     78379    712747    617220     62191     23106    385102       387
Code
  # maximum weight of the edges in network:
  cat("Max Edge Weight \n")
Max Edge Weight 
Code
  print(max(E(ig.net)$weight))
[1] 117856834
Code
  # minimum weight of the edges in network:
  cat("MIn Edge Weight \n")
MIn Edge Weight 
Code
  print(min(E(ig.net)$weight))
[1] 1
Code
  # mean & median weight of the edges in network:
  cat("Mean Edge Weight \n" )
Mean Edge Weight 
Code
  print(mean(E(ig.net)$weight))
[1] 1584591
Code
  cat("Median Edge Weight \n")
Median Edge Weight 
Code
  print(median(E(ig.net)$weight))
[1] 113854
Code
  # density
  cat("Density \n")
Density 
Code
  print(igraph::edge_density(ig.net))
[1] 0.01585408

Diad and Triad

Dyad Census:

  • Mutual Ties (dyads with reciprocal relationships): There are 102 mutual ties in the network. Mutual ties occur when two countries have a two-way trade relationship.

  • Asymmetric Ties (dyads with non-reciprocal relationships): There are 713 asymmetric ties in the network. Asymmetric ties occur when the trade relationship between two countries is one-sided or unbalanced.

  • Null Ties (dyads with no relationship): There are 28,105 null ties in the network. Null ties represent dyads where there is no trade relationship between the two countries.

Triad Census:

  • 212,8251 triads have the configuration of three vertices connected by three edges.

  • 140,157 triads have the configuration of three vertices connected by two edges and one missing edge.

  • 18,691 triads have the configuration of three vertices connected by one edge and two missing edges.

  • 2,871 triads have the configuration of three vertices connected by one edge and one missing edge.

  • 5,386 triads have the configuration of three vertices connected by two missing edges.

  • 2,693 triads have the configuration of three vertices connected by one missing edge.

  • 2,138 triads have the configuration of three vertices with all missing edges.

  • 1,129 triads have the configuration of three vertices connected by one edge and two missing edges.

  • 962 triads have the configuration of three vertices connected by all missing edges.

  • 15 triads have the configuration of three vertices with no connections.

  • 429 triads have the configuration of three vertices connected by three missing edges.

  • 717 triads have the configuration of three vertices connected by two edges and one missing edge.

  • 140 triads have the configuration of three vertices connected by one edge and two missing edges.

  • 106 triads have the configuration of three vertices connected by all missing edges.

  • 226 triads have the configuration of three vertices connected by one edge and one missing edge.

Code
dyad_census(ig.net)
$mut
[1] 102

$asym
[1] 713

$null
[1] 28105
Code
triad.census(ig.net)
 [1] 2128251  140157   18691    2871    5386    2693    2138    1129     962
[10]      15     429     717     140     106     226      49

Network Attributes (2)

Degree: The degree centrality values reveal the level of connectivity and influence of each country in the global network. With a degree centrality of 93, the Netherlands stands out as an exceptionally connected and influential country, followed closely by the United States of America with a centrality of 84. Spain holds a centrality of 62, positioning it as a significant player in the network. The United Kingdom, China, France, Italy, Malaysia, Singapore, and Germany also exhibit notable degrees of connectivity. These centrality values indicate the extensive connections and influence that these countries possess in the global arena, highlighting their roles in shaping international relations, trade, and cooperation.

In-Degree: The Netherlands leads the pack with an in-degree value of 63, showcasing its extensive network of international relationships. China follows closely with a score of 48, reflecting its position as a major global power. Spain holds a significant in-degree value of 40, highlighting its importance as a cultural and economic hub. The United States of America and France both have an in-degree value of 40, underscoring their global leadership and diplomatic ties. Italy, Singapore, and Thailand each possess an in-degree value of 35, emphasizing their economic and strategic significance. Germany and South Korea round out the top countries with in-degree values of 34, demonstrating their influence in global affairs. These countries play pivotal roles in shaping politics, economics, and cultural exchange on the international stage.

Out-Degree: The out-degree centrality values provide insights into the number of connections each country has with other countries in terms of outgoing connections. In this context, the United States of America leads with an out-degree centrality of 44, indicating a high number of outgoing connections. The Netherlands and Russia follow closely with centrality values of 30 each. The United Kingdom, Brazil, and Nigeria demonstrate significant outgoing connectivity with centrality values of 28, 27, and 26, respectively. Other countries such as Norway, Saudi Arabia, Kazakhstan, Algeria, Angola, Spain, Azerbaijan, South Africa, Libya, France, Iraq, Italy, United Arab Emirates, and Colombia also exhibit notable levels of outgoing connections. These out-degree centrality values shed light on the countries that are actively engaged in forging relationships and initiating interactions with other nations on a global scale.

Betweenness Centrality: The betweenness centrality values highlight the countries that act as pivotal intermediaries, facilitating connections and information flow within the network. The Netherlands emerges as a key player with the highest betweenness centrality of 7959.8333, followed by the United States of America at 3970.1667. Switzerland also demonstrates significant centrality at 3959.5000. Other countries such as South Africa, United Kingdom, Singapore, Italy, France, South Korea, Japan, and Spain play important roles in bridging different regions of the network. Brazil, Australia, Poland, China, Luxembourg, Colombia, Germany, and Belgium contribute as well to the network’s connectivity. These betweenness centrality values provide insights into the countries that serve as critical hubs in facilitating communication and interactions among nations in the global network.

Eigenvector Centrality: The eigenvector centrality values provide insights into the influence and importance of countries within the network, based on their connections with other influential countries. The United States of America holds the highest eigenvector centrality score of 1.00000000, indicating its strong influence and widespread connections with other countries. Canada and China also demonstrate significant centrality scores of 0.88354839 and 0.67162649, respectively. Saudi Arabia, Russia, South Korea, Iraq, United Arab Emirates, and Japan also exhibit considerable eigenvector centrality values, highlighting their influence within the network. Netherlands, Brazil, Kuwait, Mexico, Malaysia, United Kingdom, Angola, Germany, Singapore, and Taipei Chinese contribute to the network’s connectivity and influence as well. These eigenvector centrality values shed light on the countries that hold prominent positions and have the potential to exert substantial influence within the global network.

Closeness Centrality: Closeness centrality measures how quickly information can spread from a particular country to others in the network, based on the average shortest path distance. Barbados holds the highest closeness centrality score of 7.487832e-05, indicating that it has the shortest average distance to reach other countries. Israel, Hong Kong, and India also demonstrate relatively high closeness centrality scores, suggesting their accessibility and efficient information flow within the network. Malaysia, Turkey, Singapore, and New Zealand exhibit comparable closeness centrality values, indicating their proximity to other countries in terms of information exchange. Spain, Ecuador, France, China, Cuba, Kuwait, Mongolia, Niger, Trinidad and Tobago, Italy, Japan, and Netherlands also contribute to the network’s overall closeness, enabling efficient communication and information diffusion. These closeness centrality values highlight the countries that are well-connected and play a crucial role in the network’s information flow dynamics.

Constraint centrality: measures the extent to which a country serves as a bridge or bottleneck in the network, based on the number of shortest paths that pass through it. Slovakia has the highest constraint centrality score of 1.005663, indicating its crucial role in connecting other countries within the network. The Dominican Republic, Luxembourg, and Andorra also exhibit high constraint centrality values, suggesting their significance in controlling the flow of information or trade between various countries. Aruba, Bangladesh, Barbados, Belize, Bolivia, Botswana, Cambodia, Curacao, Dominica, El Salvador, European Union (EU) countries, Greenland, Iceland, Iran, Kenya, and Lesotho demonstrate constraint centrality scores of 1.000000, signifying their potential influence as intermediaries or constraints in the network. These countries are likely to play important roles in regulating the exchange of goods, information, or other resources among other nations in the network.

Analysis:

The analysis of the crude oil network highlights the significance of different countries based on various centrality measures. The Netherlands emerges as a highly connected and influential country, followed closely by the United States of America, Spain, and other key players such as the United Kingdom, China, France, and Germany. These countries demonstrate extensive connections, leadership, and active engagement in shaping international relations and trade within the crude oil network. Furthermore, the Netherlands and the United States of America serve as pivotal intermediaries, facilitating connections and information flow, while countries like Slovakia, the Dominican Republic, and Luxembourg play crucial roles in connecting other nations and controlling the flow of information. Overall, this analysis provides valuable insights into the importance of countries in the crude oil network, shedding light on their connectivity, influence, bridging capabilities, and potential control over the exchange of resources.

Code
cat("Degree: \n")
Degree: 
Code
sort(igraph::degree(ig.net), decreasing = TRUE)[1:20]
             Netherlands United_States_of_America                    Spain 
                      93                       84                       62 
          United_Kingdom                    China                   France 
                      59                       58                       53 
                   Italy                 Malaysia                Singapore 
                      53                       46                       46 
                 Germany                   Brazil                 Thailand 
                      44                       40                       38 
             South_Korea                   Norway                   Russia 
                      37                       32                       30 
               Australia             South_Africa                Indonesia 
                      29                       29                       28 
                 Belgium                  Nigeria 
                      26                       26 
Code
cat("In Degree: \n")
In Degree: 
Code
sort(igraph::degree(ig.net, mode = "in"), decreasing = TRUE)[1:20]
             Netherlands                    China                    Spain 
                      63                       48                       40 
United_States_of_America                   France                    Italy 
                      40                       36                       36 
               Singapore                 Thailand                  Germany 
                      35                       35                       34 
             South_Korea           United_Kingdom                 Malaysia 
                      34                       31                       30 
                   Japan                  Belgium                Indonesia 
                      20                       19                       19 
               Australia                   Greece           Czech_Republic 
                      18                       18                       14 
          Taipei_Chinese                  Austria 
                      14                       13 
Code
cat("Out Degree: \n")
Out Degree: 
Code
sort(igraph::degree(ig.net, mode = "out"), decreasing = TRUE)[1:20]
United_States_of_America              Netherlands                   Russia 
                      44                       30                       30 
          United_Kingdom                   Brazil                  Nigeria 
                      28                       27                       26 
                  Norway             Saudi_Arabia               Kazakhstan 
                      25                       24                       23 
                 Algeria                   Angola                    Spain 
                      22                       22                       22 
              Azerbaijan             South_Africa                    Libya 
                      20                       20                       19 
                  France                     Iraq                    Italy 
                      17                       17                       17 
    United_Arab_Emirates                 Colombia 
                      17                       16 
Code
cat("Betweenness Centrality: \n")
Betweenness Centrality: 
Code
sort(igraph::betweenness(ig.net),decreasing = TRUE)[1:20]
             Netherlands United_States_of_America              Switzerland 
               7959.8333                3970.1667                3959.5000 
            South_Africa           United_Kingdom                Singapore 
               3438.5000                2042.0000                2016.0000 
                   Italy                   France              South_Korea 
               1948.0000                1579.3333                1422.0000 
                   Japan              New_Zealand                    Spain 
               1402.0000                1260.0000                1256.0000 
                  Brazil                Australia                   Poland 
               1217.0000                1065.0000                1044.0000 
                   China               Luxembourg                 Colombia 
                896.1667                 869.1667                 864.0000 
                 Germany                  Belgium 
                791.0000                 782.0000 
Code
cat("Eigenvector Centrality \n")
Eigenvector Centrality 
Code
sort(igraph::eigen_centrality(ig.net)$vector,decreasing = TRUE)[1:20]
United_States_of_America                   Canada                    China 
              1.00000000               0.88354839               0.67162649 
            Saudi_Arabia                   Russia              South_Korea 
              0.58629154               0.30412826               0.29781153 
                    Iraq     United_Arab_Emirates                    Japan 
              0.25633142               0.24177585               0.23775259 
             Netherlands                   Brazil                   Kuwait 
              0.17862049               0.16746186               0.15387946 
                  Mexico                 Malaysia                     Oman 
              0.14996240               0.13452897               0.13349027 
          United_Kingdom                   Angola                  Germany 
              0.13306143               0.11766084               0.11199193 
               Singapore           Taipei_Chinese 
              0.10490506               0.09753917 
Code
cat("Closeness Centrality \n")
Closeness Centrality 
Code
sort(igraph::closeness(ig.net),decreasing = TRUE)[1:20]
           Barbados              Israel            Hongkong               India 
       7.487832e-05        3.056085e-06        3.772090e-07        3.724994e-07 
           Malaysia              Turkey           Singapore         New_Zealand 
       3.696515e-07        3.672061e-07        3.655520e-07        3.655382e-07 
              Spain             Ecuador              France               China 
       3.655285e-07        3.655154e-07        3.654896e-07        3.654860e-07 
               Cuba              Kuwait            Mongolia               Niger 
       3.654821e-07        3.654756e-07        3.654615e-07        3.654579e-07 
Trinidad_and_Tobago               Italy               Japan         Netherlands 
       3.654195e-07        3.654161e-07        3.654115e-07        3.653901e-07 
Code
cat("Constraint Centrality: \n")
Constraint Centrality: 
Code
sort(igraph::constraint(ig.net),decreasing = TRUE)[1:20]
          Slovakia Dominican_Republic         Luxembourg            Andorra 
          1.005663           1.000930           1.000098           1.000000 
             Aruba         Bangladesh           Barbados             Belize 
          1.000000           1.000000           1.000000           1.000000 
           Bolivia           Botswana           Cambodia            Curacao 
          1.000000           1.000000           1.000000           1.000000 
          Dominica        El_Salvador European_Union_Nes          Greenland 
          1.000000           1.000000           1.000000           1.000000 
           Iceland               Iran              Kenya            Lesotho 
          1.000000           1.000000           1.000000           1.000000 

In, Out Trade Volume on Nodes

Code
cat("Trade Volume Import (Strength: \n")
Trade Volume Import (Strength: 
Code
V(ig.net)$in_weight <- strength(ig.net, mode = "in", weights = E(ig.net)$attribute)

V(ig.net)$in_weight
  [1]         0         0         0         2         0         0         1
  [8]         0         0         0  10223762         2         0     92592
 [15]         0   7201893   3873821         2    141450         0     56868
 [22]         0         0  25091909         0         0         0         0
 [29]         1         0       102         5  10175334         0         0
 [36]   1273742   4121091         0         0         0         0         1
 [43]  17198384         0         0         0         0   5758299 366686768
 [50]         0         0    875121         0         0         4         0
 [57]         0   1496514         7     73534      7023   4906132   3681677
 [64]         0     28500    717948         6         0        87         0
 [71]         0      7702         0       170         0      2104         0
 [78]         0         0   7368876  35712407         0         0         0
 [85]         0         0       762  62337001         0     23406  15662935
 [92]        13         0      1173         0         0         0         0
 [99]         0     86108   3400640         1  15162962  11694688         0
[106]         0   2495077  10819660  47318018    421886    359480 101257641
[113]         0         0         2         0         0         0         0
[120]         0         0         3         0       276         0         0
[127]   6202343     25758         0         1         2  13545852         0
[134]       294         2         0         0         0         0       100
[141]         0         5         0         0         0         9        17
[148]    295164        36         0         0  77943430         0         0
[155]    563754    155293         0         0         0         0         0
[162]         0         0   1190509         0         0         0         0
[169]         0   5968853     42448         1   2556906    173742         0
[176]  17824888   7757608        13   5881750         0         0        12
[183]         0         0         0         0         0         0         0
[190]    428947   2295581         0         0         0         2  35544680
[197]   2903557         1         0         0   4432439 106278517         0
[204]  47738163         0         0         0         0  15023555   2308059
[211]         0  30984679         0         0  39155147         1         1
[218]         0         0         0         0    270189         0         0
[225]         0         0       169     59950  39947535     26116 205505482
[232]   2002305         0         0         0    220356         0         0
[239]         0        13        15
Code
cat("Trade Volume Export (Strength: \n")
Trade Volume Export (Strength: 
Code
V(ig.net)$out_weight <- strength(ig.net, mode = "out", weights = E(ig.net)$attribute)

V(ig.net)$out_weight
  [1]         0         0    317482  17502344         0         0         0
  [8]  38236228         0         0  10429850   3291328         0         0
 [15]         0  18333894     11766  18507428         0    423858         0
 [22]     13355         0   1020470      1173         0         0         0
 [29]       396         0      5387         0  49306832         0         0
 [36]   1984162      3237         0         0         0     33506   2270061
 [43] 124856692         0         0         0   3669722     36880   1438115
 [50]         0         0  23093065         0   6902806   1066507         0
 [57]         0    395422      6633         0         1       118    610282
 [64]         0         0         0  10147597   1564624         0   3441079
 [71]         0     43517         0         0         0         0         0
 [78]         0         0        16    147656         0         0         0
 [85]   5599710         0         0    140121   5574627     92972    336412
 [92]         0         0     81401         0         0   9202333         0
 [99]         0         1     83843         0      2293   2221085    560630
[106]  83233976     45497    327216    848269    637944         0     89676
[113]         0  36748389         0         0  51919408         0         0
[120]         0         0      4318         0         0      9006  32316719
[127]     78901         2         0         0         0  30860932         0
[134]         0     71828         0         0         0         0  29202094
[141]         0       950    243494         0         0     55391         0
[148]     22044         1         0         0  30515935         0         0
[155]    772558         0         2  41419717         0         0         0
[162]         0         0  65415913         0  33205320    255394         0
[169]         0      1287    700818         0    520444    291076         0
[176]    110706        26  23225973    297509 123778614         0         0
[183]         0         0         0         0         0         0 221147198
[190]     28568         0         0         0     57722         0    111972
[197]      1505        87         0         0    195680     19896    418800
[204]    576065     82650         0    709242        10     11933         5
[211]         0         0         0         0    535266    288390     22973
[218]         0         0   2271095    681728    710736    145818         0
[225]         0         0       362 111127635  27926876         0 131959478
[232]    140861         0         0    556136   2016865         0         0
[239]   1087619       387         0

Community Clusters

Code
# cluster_fast_greedy
community_fast <- cluster_fast_greedy(as.undirected(ig.net))

# get groups

igraph::groups(community_fast)
$`1`
 [1] "Angola"                              
 [2] "Bangladesh"                          
 [3] "Barbados"                            
 [4] "Bolivia"                             
 [5] "Brazil"                              
 [6] "Bulgaria"                            
 [7] "Chile"                               
 [8] "China"                               
 [9] "Congo"                               
[10] "Congo_DR"                            
[11] "Curacao"                             
[12] "Cyprus"                              
[13] "Egypt"                               
[14] "Gabon"                               
[15] "Georgia"                             
[16] "Greece"                              
[17] "Hungary"                             
[18] "Iran"                                
[19] "Iraq"                                
[20] "Jamaica"                             
[21] "Kuwait"                              
[22] "Latvia"                              
[23] "Luxembourg"                          
[24] "Malaysia"                            
[25] "Mongolia"                            
[26] "Mozambique"                          
[27] "Myanmar"                             
[28] "Niger"                               
[29] "Oman"                                
[30] "Papua_New_Guinea"                    
[31] "Paraguay"                            
[32] "Poland"                              
[33] "Portugal"                            
[34] "Russia"                              
[35] "Serbia"                              
[36] "Slovakia"                            
[37] "South_Sudan"                         
[38] "Timor.Leste"                         
[39] "United_States_Minor_Outlying_Islands"
[40] "Yemen"                               

$`2`
 [1] "Albania"                 "Algeria"                
 [3] "Andorra"                 "Austria"                
 [5] "Azerbaijan"              "Belgium"                
 [7] "Botswana"                "Cameroon"               
 [9] "Chad"                    "Croatia"                
[11] "Cuba"                    "Czech_Republic"         
[13] "Denmark"                 "Equatorial_Guinea"      
[15] "Estonia"                 "European_Union_Nes"     
[17] "Finland"                 "France"                 
[19] "Germany"                 "Greenland"              
[21] "Guyana"                  "Iceland"                
[23] "Indonesia"               "Italy"                  
[25] "Kazakhstan"              "Kenya"                  
[27] "Lesotho"                 "Libya"                  
[29] "Lithuania"               "Madagascar"             
[31] "Malawi"                  "Mali"                   
[33] "Malta"                   "Moldova"                
[35] "Namibia"                 "Netherlands"            
[37] "Nigeria"                 "Norway"                 
[39] "Romania"                 "Saint_Helena"           
[41] "Senegal"                 "Ship_stores_and_bunkers"
[43] "Sierra_Leone"            "South_Africa"           
[45] "Spain"                   "Special_categories"     
[47] "Sudan"                   "Suriname"               
[49] "Sweden"                  "Switzerland"            
[51] "Togo"                    "Tunisia"                
[53] "Turkey"                  "Turkmenistan"           
[55] "Ukraine"                 "United_Kingdom"         
[57] "Venezuela"               "Zambia"                 
[59] "Zimbabwe"               

$`3`
[1] "Area_Nes"               "Australia"              "Bosnia_and_Herzegovina"
[4] "Brunei_Darussalam"      "Israel"                 "Slovenia"              

$`4`
 [1] "Argentina"                "Aruba"                   
 [3] "Bahamas"                  "Belize"                  
 [5] "Canada"                   "Colombia"                
 [7] "Dominica"                 "Dominican_Republic"      
 [9] "Ecuador"                  "El_Salvador"             
[11] "Ghana"                    "Gibraltar"               
[13] "Guatemala"                "Hongkong"                
[15] "India"                    "Ireland"                 
[17] "Ivory_Coast"              "Liberia"                 
[19] "Mexico"                   "Nicaragua"               
[21] "Panama"                   "Peru"                    
[23] "Trinidad_and_Tobago"      "United_States_of_America"
[25] "Uruguay"                 

$`5`
 [1] "Bahrain"              "Cambodia"             "Ethiopia"            
 [4] "Japan"                "Morocco"              "New_Zealand"         
 [7] "Pakistan"             "Philippines"          "Qatar"               
[10] "Saudi_Arabia"         "Singapore"            "South_Korea"         
[13] "Taipei_Chinese"       "Thailand"             "United_Arab_Emirates"
[16] "Viet_Nam"            

$`6`
[1] "Afghanistan"

$`7`
[1] "Africa_nes"

$`8`
[1] "America_nes"

$`9`
[1] "American_Samoa"

$`10`
[1] "Anguilla"

$`11`
[1] "Antigua_and_Barbuda"

$`12`
[1] "Armenia"

$`13`
[1] "Asia_nes"

$`14`
[1] "Belarus"

$`15`
[1] "Benin"

$`16`
[1] "Bermuda"

$`17`
[1] "Bhutan"

$`18`
[1] "Bonaire_Sint_Eustatius_and_Saba"

$`19`
[1] "British_Indian_Ocean_Territory"

$`20`
[1] "British_Virgin_Islands"

$`21`
[1] "Burkina_Faso"

$`22`
[1] "Burundi"

$`23`
[1] "Cabo_Verde"

$`24`
[1] "Caribbean_Nes"

$`25`
[1] "Cayman_Islands"

$`26`
[1] "Central_African_Republic"

$`27`
[1] "Christmas_Island"

$`28`
[1] "Cocos_.Keeling._Islands"

$`29`
[1] "Comoros"

$`30`
[1] "Cook_Islands"

$`31`
[1] "Costa_Rica"

$`32`
[1] "Djibouti"

$`33`
[1] "Eritrea"

$`34`
[1] "Eswatini"

$`35`
[1] "Europe_Othr._Nes"

$`36`
[1] "Falkland_Islands_.Malvinas."

$`37`
[1] "Faroe_Islands"

$`38`
[1] "Fiji"

$`39`
[1] "Free_Zones"

$`40`
[1] "French_Polynesia"

$`41`
[1] "French_Southern_and_Antarctic_Territories"

$`42`
[1] "Gambia"

$`43`
[1] "Grenada"

$`44`
[1] "Guinea"

$`45`
[1] "Guinea.Bissau"

$`46`
[1] "Haiti"

$`47`
[1] "Honduras"

$`48`
[1] "Jordan"

$`49`
[1] "Kiribati"

$`50`
[1] "Kyrgyzstan"

$`51`
[1] "LAIA_nes"

$`52`
[1] "Laos"

$`53`
[1] "Laso"

$`54`
[1] "Lebanon"

$`55`
[1] "Macedonia"

$`56`
[1] "Maldives"

$`57`
[1] "Marshall_Islands"

$`58`
[1] "Mauritania"

$`59`
[1] "Mauritius"

$`60`
[1] "Mayotte"

$`61`
[1] "Micronesia"

$`62`
[1] "Montenegro"

$`63`
[1] "Montserrat"

$`64`
[1] "Nauru"

$`65`
[1] "Nepal"

$`66`
[1] "Netherlands_Antilles"

$`67`
[1] "New_Caledonia"

$`68`
[1] "Niue"

$`69`
[1] "Norfolk_Island"

$`70`
[1] "North_America_and_Central_America_nes"

$`71`
[1] "North_Korea"

$`72`
[1] "Northern_Mariana_Islands"

$`73`
[1] "Oceania_Nes"

$`74`
[1] "Palau"

$`75`
[1] "Palestine"

$`76`
[1] "Pitcairn"

$`77`
[1] "Rwanda"

$`78`
[1] "Saint_Kitts_and_Nevis"

$`79`
[1] "Saint_Lucia"

$`80`
[1] "Saint_Pierre_and_Miquelon"

$`81`
[1] "Saint_Vincent_and_the_Grenadines"

$`82`
[1] "Samoa"

$`83`
[1] "Sao_Tome_and_Principe"

$`84`
[1] "Serbia_and_Montenegro"

$`85`
[1] "Seychelles"

$`86`
[1] "Solomon_Islands"

$`87`
[1] "Somalia"

$`88`
[1] "Sri_Lanka"

$`89`
[1] "Syria"

$`90`
[1] "Tajikistan"

$`91`
[1] "Tanzania"

$`92`
[1] "Tokelau"

$`93`
[1] "Tonga"

$`94`
[1] "Turks_and_Caicos_Islands"

$`95`
[1] "Tuvalu"

$`96`
[1] "Uganda"

$`97`
[1] "Uzbekistan"

$`98`
[1] "Vanuatu"

$`99`
[1] "Wallis_and_Futuna_Islands"

$`100`
[1] "West_Asia_nes"
Code
# plot fast and greedy
#png(filename = "fg_comms.png") # save as png
plot(community_fast, ig.net, vertex.shape = "circle", vertex.size = 7, vertex.label.cex = .5, vertex.label.color = "black", edge.arrow.size = .25, rescale = TRUE, asp = 0, sub = "Fast and Greedy Method")

Code
#cluster_walktrap
community_walktrap <- walktrap.community(as.undirected(ig.net))

# get groups

igraph::groups(community_walktrap)
$`1`
  [1] "Albania"                  "Algeria"                 
  [3] "Angola"                   "Argentina"               
  [5] "Australia"                "Austria"                 
  [7] "Azerbaijan"               "Bahamas"                 
  [9] "Bahrain"                  "Belgium"                 
 [11] "Brazil"                   "Brunei_Darussalam"       
 [13] "Bulgaria"                 "Cameroon"                
 [15] "Canada"                   "Chad"                    
 [17] "Chile"                    "China"                   
 [19] "Colombia"                 "Congo"                   
 [21] "Congo_DR"                 "Croatia"                 
 [23] "Cuba"                     "Cyprus"                  
 [25] "Czech_Republic"           "Denmark"                 
 [27] "Dominican_Republic"       "Ecuador"                 
 [29] "Egypt"                    "Equatorial_Guinea"       
 [31] "Estonia"                  "Finland"                 
 [33] "France"                   "Gabon"                   
 [35] "Germany"                  "Ghana"                   
 [37] "Gibraltar"                "Greece"                  
 [39] "Guatemala"                "Guyana"                  
 [41] "Hongkong"                 "Hungary"                 
 [43] "India"                    "Indonesia"               
 [45] "Iran"                     "Iraq"                    
 [47] "Ireland"                  "Italy"                   
 [49] "Ivory_Coast"              "Jamaica"                 
 [51] "Japan"                    "Kazakhstan"              
 [53] "Kuwait"                   "Latvia"                  
 [55] "Liberia"                  "Libya"                   
 [57] "Lithuania"                "Luxembourg"              
 [59] "Malaysia"                 "Malta"                   
 [61] "Mexico"                   "Mongolia"                
 [63] "Morocco"                  "Myanmar"                 
 [65] "Netherlands"              "New_Zealand"             
 [67] "Nicaragua"                "Nigeria"                 
 [69] "Norway"                   "Oman"                    
 [71] "Pakistan"                 "Panama"                  
 [73] "Papua_New_Guinea"         "Peru"                    
 [75] "Philippines"              "Poland"                  
 [77] "Portugal"                 "Qatar"                   
 [79] "Romania"                  "Russia"                  
 [81] "Saudi_Arabia"             "Senegal"                 
 [83] "Serbia"                   "Singapore"               
 [85] "Slovakia"                 "South_Africa"            
 [87] "South_Korea"              "South_Sudan"             
 [89] "Spain"                    "Special_categories"      
 [91] "Sudan"                    "Sweden"                  
 [93] "Switzerland"              "Taipei_Chinese"          
 [95] "Thailand"                 "Timor.Leste"             
 [97] "Togo"                     "Trinidad_and_Tobago"     
 [99] "Tunisia"                  "Turkey"                  
[101] "Turkmenistan"             "United_Arab_Emirates"    
[103] "United_Kingdom"           "United_States_of_America"
[105] "Uruguay"                  "Venezuela"               
[107] "Viet_Nam"                 "Yemen"                   

$`2`
[1] "Area_Nes"               "Bosnia_and_Herzegovina" "Israel"                

$`3`
[1] "Afghanistan"

$`4`
[1] "Africa_nes"

$`5`
[1] "America_nes"

$`6`
[1] "American_Samoa"

$`7`
[1] "Andorra"

$`8`
[1] "Anguilla"

$`9`
[1] "Antigua_and_Barbuda"

$`10`
[1] "Armenia"

$`11`
[1] "Aruba"

$`12`
[1] "Asia_nes"

$`13`
[1] "Bangladesh"

$`14`
[1] "Barbados"

$`15`
[1] "Belarus"

$`16`
[1] "Belize"

$`17`
[1] "Benin"

$`18`
[1] "Bermuda"

$`19`
[1] "Bhutan"

$`20`
[1] "Bolivia"

$`21`
[1] "Bonaire_Sint_Eustatius_and_Saba"

$`22`
[1] "Botswana"

$`23`
[1] "British_Indian_Ocean_Territory"

$`24`
[1] "British_Virgin_Islands"

$`25`
[1] "Burkina_Faso"

$`26`
[1] "Burundi"

$`27`
[1] "Cabo_Verde"

$`28`
[1] "Cambodia"

$`29`
[1] "Caribbean_Nes"

$`30`
[1] "Cayman_Islands"

$`31`
[1] "Central_African_Republic"

$`32`
[1] "Christmas_Island"

$`33`
[1] "Cocos_.Keeling._Islands"

$`34`
[1] "Comoros"

$`35`
[1] "Cook_Islands"

$`36`
[1] "Costa_Rica"

$`37`
[1] "Curacao"

$`38`
[1] "Djibouti"

$`39`
[1] "Dominica"

$`40`
[1] "El_Salvador"

$`41`
[1] "Eritrea"

$`42`
[1] "Eswatini"

$`43`
[1] "Ethiopia"

$`44`
[1] "Europe_Othr._Nes"

$`45`
[1] "European_Union_Nes"

$`46`
[1] "Falkland_Islands_.Malvinas."

$`47`
[1] "Faroe_Islands"

$`48`
[1] "Fiji"

$`49`
[1] "Free_Zones"

$`50`
[1] "French_Polynesia"

$`51`
[1] "French_Southern_and_Antarctic_Territories"

$`52`
[1] "Gambia"

$`53`
[1] "Georgia"

$`54`
[1] "Greenland"

$`55`
[1] "Grenada"

$`56`
[1] "Guinea"

$`57`
[1] "Guinea.Bissau"

$`58`
[1] "Haiti"

$`59`
[1] "Honduras"

$`60`
[1] "Iceland"

$`61`
[1] "Jordan"

$`62`
[1] "Kenya"

$`63`
[1] "Kiribati"

$`64`
[1] "Kyrgyzstan"

$`65`
[1] "LAIA_nes"

$`66`
[1] "Laos"

$`67`
[1] "Laso"

$`68`
[1] "Lebanon"

$`69`
[1] "Lesotho"

$`70`
[1] "Macedonia"

$`71`
[1] "Madagascar"

$`72`
[1] "Malawi"

$`73`
[1] "Maldives"

$`74`
[1] "Mali"

$`75`
[1] "Marshall_Islands"

$`76`
[1] "Mauritania"

$`77`
[1] "Mauritius"

$`78`
[1] "Mayotte"

$`79`
[1] "Micronesia"

$`80`
[1] "Moldova"

$`81`
[1] "Montenegro"

$`82`
[1] "Montserrat"

$`83`
[1] "Mozambique"

$`84`
[1] "Namibia"

$`85`
[1] "Nauru"

$`86`
[1] "Nepal"

$`87`
[1] "Netherlands_Antilles"

$`88`
[1] "New_Caledonia"

$`89`
[1] "Niger"

$`90`
[1] "Niue"

$`91`
[1] "Norfolk_Island"

$`92`
[1] "North_America_and_Central_America_nes"

$`93`
[1] "North_Korea"

$`94`
[1] "Northern_Mariana_Islands"

$`95`
[1] "Oceania_Nes"

$`96`
[1] "Palau"

$`97`
[1] "Palestine"

$`98`
[1] "Paraguay"

$`99`
[1] "Pitcairn"

$`100`
[1] "Rwanda"

$`101`
[1] "Saint_Helena"

$`102`
[1] "Saint_Kitts_and_Nevis"

$`103`
[1] "Saint_Lucia"

$`104`
[1] "Saint_Pierre_and_Miquelon"

$`105`
[1] "Saint_Vincent_and_the_Grenadines"

$`106`
[1] "Samoa"

$`107`
[1] "Sao_Tome_and_Principe"

$`108`
[1] "Serbia_and_Montenegro"

$`109`
[1] "Seychelles"

$`110`
[1] "Ship_stores_and_bunkers"

$`111`
[1] "Sierra_Leone"

$`112`
[1] "Slovenia"

$`113`
[1] "Solomon_Islands"

$`114`
[1] "Somalia"

$`115`
[1] "Sri_Lanka"

$`116`
[1] "Suriname"

$`117`
[1] "Syria"

$`118`
[1] "Tajikistan"

$`119`
[1] "Tanzania"

$`120`
[1] "Tokelau"

$`121`
[1] "Tonga"

$`122`
[1] "Turks_and_Caicos_Islands"

$`123`
[1] "Tuvalu"

$`124`
[1] "Uganda"

$`125`
[1] "Ukraine"

$`126`
[1] "United_States_Minor_Outlying_Islands"

$`127`
[1] "Uzbekistan"

$`128`
[1] "Vanuatu"

$`129`
[1] "Wallis_and_Futuna_Islands"

$`130`
[1] "West_Asia_nes"

$`131`
[1] "Zambia"

$`132`
[1] "Zimbabwe"
Code
plot(community_walktrap, ig.net, vertex.shape = "circle", vertex.size = 7, vertex.label.cex = .5, vertex.label.color = "black", edge.arrow.size = .25, rescale = TRUE, asp = 0, sub = "Fast and Greedy Method")

Walktrap: Walktrap is a community detection algorithm based on random walks within a graph. It tends to generate a single big cluster when applied to a dataset. This can be beneficial if the goal is to identify a cohesive group or a global pattern within the crude oil trade data. By identifying a single cluster, Walktrap may help uncover overall trends, relationships, or dynamics in the market.

Fast Greedy: Fast greedy is a hierarchical clustering algorithm that builds clusters by iteratively merging the most similar nodes or clusters. It tends to generate multiple clusters, typically 3-4 major ones in your case. This approach is useful it is required identify distinct subgroups or segments within the crude oil trade market. It allows for a more granular analysis and can reveal different trading patterns, regional differences, or market segments.