<figure><img src="image_1.png" /></figure>

HAL
open science

# Triadic Motifs and Dyadic Self-Organization in the World Trade Network

Tiziano Squartini, Diego Garlaschelli

► To cite this version:

Tiziano Squartini, Diego Garlaschelli. Triadic Motifs and Dyadic Self-Organization in the World Trade Network. 6th International Workshop on Self-Organizing Systems (IWSOS), Mar 2012, Delft, Netherlands. pp.24-35, 10.1007/978-3-642-28583-7_3 . hal-01527529

HAL Id: hal-01527529

https://inria.hal.science/hal-01527529

Submitted on 24 May 2017

**HAL** is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Triadic motifs and dyadic self-organization in the World Trade Network

Tiziano Squartini¹,²,³ and Diego Garlaschelli¹

¹ Instituut-Lorentz for Theoretical Physics, Leiden Institute of Physics, University of Leiden, Niels Bohrweg 2, 2333 CA Leiden (The Netherlands)

² Department of Physics, University of Siena, via Roma 56, 53100 Siena (Italy)

³ Center for the Study of Complex Systems, via Roma 56, 53100 Siena (Italy)

**Abstract.** In self-organizing networks, topology and dynamics coevolve in a continuous feedback, without exogenous driving. The World Trade Network (WTN) is one of the few empirically well documented examples of self-organizing networks: its topology depends on the GDP of world countries, which in turn depends on the structure of trade. Therefore, understanding the WTN topological properties deviating from randomness provides direct empirical information about the structural effects of self-organization. Here, using an analytical pattern-detection method we have recently proposed, we study the occurrence of triadic 'motifs' (three-vertices subgraphs) in the WTN between 1950 and 2000. We find that motifs are not explained by only the in- and out-degree sequences, but they are completely explained if also the numbers of reciprocal edges are taken into account. This implies that the self-organization process underlying the evolution of the WTN is almost completely encoded into the dyadic structure, which strongly depends on reciprocity.

## 1 Introduction

The global economy is a prototypic example of complex self-organizing system, whose collective properties emerge spontaneously through many local interactions. In particular, international trade between countries defines a complex network which arises as the combination of many independent choices of firms. It was shown that the topology of the World Trade Network (WTN) strongly depends on the Gross Domestic Product (GDP) of world countries [1]. On the other hand, the GDP depends on international trade by definition [2], which implies that the WTN is a remarkably well documented example of adaptive network, where dynamics and topology coevolve in a continuous feedback. In general, understanding self-organizing networks is a major challenge for science, as only few models of such networks are analytically solvable [3]. However, in the particular case of the WTN, the binary topology of the network is found to be extremely well reproduced by a null model which incorporates the degree sequence [4]. These results, which have been obtained using a fast network randomization method that we have recently proposed [5], make the WTN particularly interesting. In this paper, after briefly reviewing our randomization method, we apply it
to study the occurrence of triadic 'motifs', i.e. directed patterns involving three vertices (see Fig.1). We show that, unlike other properties which have been studied elsewhere [4], the occurrence of motifs is not explained by only the in- and out-degrees of vertices. However, if also the numbers of reciprocal links of each vertex (the reciprocal degree sequence) are taken into account, the occurrences of triadic motifs are almost completely reproduced. This implies that, if local information is enhanced in order to take into account the reciprocity structure, motifs display no significant deviations from random expectations. Therefore the (in principle complicated) self-organization process underlying the evolution of the WTN turns out to be relatively simply encoded into the local dyadic structure, which separately specifies the number of reciprocated and non-reciprocated links per vertex. Thus the dyadic structure appears to carry a large amount of information about the system.

# 2 Searching for Non-Random Patterns in the WTN

In this section we briefly summarize our recently proposed randomization method and how it can be used to detect patterns when local constraints are considered.

## 2.1 Network Pattern Detection: the Randomization Method

Our method, which is based on the maximum-likelihood estimation of maximum-entropy models of graphs, introduces a family of null models of a real network and uses it to detect topological patterns analytically [5]. Defining a null model means setting up a method to assign probabilities [6–8]. In our approach, a real network $G^*$ with $N$ vertices is given (either a binary or a weighted graph, and either directed or undirected, whose generic entry is $g_{ij}$) and a way to generate a family $G$ of randomized variants of $G^*$ is provided, by assigning each graph $G \in G$ a probability $P(G)$. In the method, the probabilities $P(G)$ are such that a maximally random ensemble of networks is generated, under the constraint that, on average, a set $\{C_a\}$ of desired topological properties is set equal to the values $\{C_a(G^*)\}$ observed in the real network $G^*$. This is achieved as the result of a constrained Shannon-Gibbs entropy maximization [8]

$$S = - \sum_{G} P(G) \ln P(G) \qquad (1)$$

and the imposed constraints are the normalization of the probability and the average values of a number of chosen properties, $\{C_a\}$:

$$1 = \sum_{G} P(G), \quad \langle C_a \rangle = \sum_{G} C_a(G) P(G) . \qquad (2)$$

This optimization leads to exponential probability coefficients [8]

$$P(G) = \frac{e^{-H(G, \theta)}}{Z} \qquad (3)$$
where the linear combination of the constraints $H(\mathbf{G}, \boldsymbol{\theta}) \equiv \sum_a \theta_a C_a(\mathbf{G})$ is called graph hamiltonian (the coefficients $\{\theta_a\}$ are free parameters, acting as Lagrange multipliers controlling the expected values $\{\langle C_a \rangle\}$) and the denominator $Z \equiv \sum_{\mathbf{G}} e^{-H(\mathbf{G}, \boldsymbol{\theta})}$ is called partition function.

The next step is the maximization of the probability $P(\mathbf{G}^*)$ to obtain the observed graph $\mathbf{G}^*$, i.e. the real-world network to randomize [5]. This step fixes the values of the Lagrange multipliers as they are found by maximizing the log-likelihood

$$ \mathcal{L}(\boldsymbol{\theta}) \equiv \ln P(\mathbf{G}^*|\boldsymbol{\theta}) = -H(\mathbf{G}^*, \boldsymbol{\theta}) - \ln Z(\boldsymbol{\theta}) \quad (4) $$

to obtain the real network $\mathbf{G}^*$. It can be easily verified [9] that this is achieved by the parameter values $\boldsymbol{\theta}^*$ satisfying

$$ \langle C_a \rangle^* = \sum_{\mathbf{G}} C_a(\mathbf{G}) P(\mathbf{G}|\boldsymbol{\theta}^*) = C_a(\mathbf{G}^*) \quad \forall a \quad (5) $$

that is, that the ensemble average of each constraint, $\langle C_a \rangle$, equals the observed value on the real network, $C_a(\mathbf{G}^*)$. Once the numerical values of the Lagrange multipliers are found, they can be used to find the ensemble average $\langle X \rangle^*$ of any topological property $X$ of interest [5]:

$$ \langle X \rangle^* = \sum_{\mathbf{G}} X(\mathbf{G}) P(\mathbf{G}|\boldsymbol{\theta}^*) . \quad (6) $$

The exact computation of the expected values can be very difficult. For this reason it is often necessary to rest on the linear approximation method [5]. However, in the present study we will consider particular topological properties $X$ (i.e. motif counts, see below) whose expected value can be evaluated exactly. Our method also allows to obtain the variance of $X$ by applying the usual definition:

$$ \sigma^2[X] = \langle [X(\mathbf{G}) - \langle X \rangle]^2 \rangle = \sum_{i,j} \sum_{t,s} \sigma[g_{ij}, g_{ts}] \left( \frac{\partial X}{\partial g_{ij}} \frac{\partial X}{\partial g_{ts}} \right)_{\mathbf{G}=\langle \mathbf{G} \rangle} \quad (7) $$

where $\sigma[g_{ij}, g_{ts}]$ is the covariance of the adjacency matrix elements $g_{ij}$ and $g_{ts}$. This formula can be greatly simplified by considering probabilities that are factorizable in terms of dyadic probabilities, as follows

$$ P(\mathbf{G}|\boldsymbol{\theta}) = \prod_{i<j} D_{ij}(g_{ij}, g_{ji}|\boldsymbol{\theta}) \quad (8) $$

where the product runs over all the dyads, that is the unordered pairs of vertices $(i, j)$ (with $i < j$), and $D_{ij}(g, g'|\boldsymbol{\theta})$ is the joint probability that $g_{ij} = g$ and $g_{ji} = g'$. Finally, the variance of $X$ evaluated in $\boldsymbol{\theta}^*$ becomes

$$ (\sigma^*[X])^2 = \sum_{i,j} \left[ \left( \sigma^*[g_{ij}] \frac{\partial X}{\partial g_{ij}} \right)^2_{\mathbf{G}=\langle \mathbf{G} \rangle^*} + \sigma^*[g_{ij}, g_{ji}] \left( \frac{\partial X}{\partial g_{ij}} \frac{\partial X}{\partial g_{ji}} \right)_{\mathbf{G}=\langle \mathbf{G} \rangle^*} \right] . \quad (9) $$
The joint knowledge of $\langle X \rangle^*$ and $\sigma^*[X]$ allows to detect deviations from randomness in the observed topology. In particular, as we show later, it is possible to calculate by how many standard deviations the observed value $X^*$ differs from the expected value $\langle X \rangle^*$. Quantities which are consistent with their expected value are explained by the enforced constraints $\{C_a\}$. On the other hand, significantly deviating properties cannot be traced back to the constraints and therefore signal the incompleteness of the information encoded in the constraints. Other approaches achieve this result by explicitly generating many randomized variants of the real network, measuring $X$ on each such variant, and finally computing the sample average and standard deviation of $X$ [6]. This is extremely time consuming, especially for complicated topological properties. By contrast, our method is entirely analytical. It yields any expected quantity $\langle X \rangle^*$ in a time as short as that required in order to measure $X^*$ on the single network $G^*$ [5].

## 2.2 The Role of Local Constraints

If the network is a binary graph (i.e. if each graph $G$ in the ensemble is uniquely specified by its adjacency matrix $A$), then the simplest (i.e. local) choice of the constraints is the *degree sequence*, i.e. the vector of degrees (numbers of incident links) of all vertices. For directed networks, which are our interest here, there are actually two degree sequences: the observed in-degree sequence $\mathbf{k}^{\text{in}}(A^*)$ (with $k_i^{\text{in}} = \sum_{j \neq i} a_{ji}$) and the observed out-degree sequence $\mathbf{k}^{\text{out}}(A^*)$ (with $k_i^{\text{out}} = \sum_{j \neq i} a_{ij}$). This null model, which is known as the *directed configuration model* (DCM), can be completely dealt with analytically using our method (see Appendix). When applied to the WTN, the DCM shows that many topological properties (such as the degree-degree correlations and the directed clustering coefficients) are in complete accordance with the expectations [4]. This shows that the degree sequences $\mathbf{k}^{\text{in}}$ and $\mathbf{k}^{\text{out}}$ are extremely informative, as their (partial) knowledge allows to reconstruct many aspects of the (complete) topology. On the other hand, it was also shown that the *reciprocity* of the WTN is highly non-trivial [10]. This means that the occurrence of reciprocal links is much higher than expected under any model which, as the DCM, treats two reciprocal links (e.g. $i \to j$ and $j \to i$) as statistically independent. A direct consequence is that the reciprocity, as well as any higher-order directional pattern, should not be reproduced by the DCM. These seemingly conflicting results can only be reconciled if, for some reason, the topological properties that have been studied under the DCM [4] mask the effects of reciprocity. In particular, the directed clustering coefficients, which are based on ratios of realized triangles over the maximum number for each vertex, may show no overall deviation from the DCM, even if the numerator and denominator separately deviate from it. In what follows, we investigate this possibility by considering all the observed subgraphs of three vertices (which include both open and closed triangles) separately. Also, we will use an additional null model which also takes the number of reciprocal links of each vertex into account. This second null model is the *reciprocal configuration model* (RCM) [5, 10, 11]. The local constraints defining it are the three, observed directed-degree sequences $\mathbf{k}^{\to}(A^*)$, with $k_i^{\to} \equiv \sum_{j \neq i} a_{ij}^{\to}$
(non-reciprocated out degree), $\mathbf{k}^{\leftarrow}(\mathbf{A}^*)$, with $k_i^{\leftarrow} = \sum_{j \neq i} a_{ij}^{\leftarrow}$ (non-reciprocated in-degree) and $\mathbf{k}^{\leftrightarrow}(\mathbf{A}^*)$}, with $k_i^{\leftrightarrow} = \sum_{j \neq i} a_{ij}^{\leftrightarrow}$ (reciprocated degree) to be imposed across the ensemble of networks having the same number of vertices of the observed configuration and, on average, the above-mentioned directed-degree sequences. In the Appendix we describe both the DCM and the RCM in more detail, and derive their expectations explicitly.

## 2.3 Triadic Motifs in the WTN

In the following analyses, we use yearly bilateral data on exports and imports from the Gleditsch Database<fnref n="4" /> to analyse the six years 1950, 1960, 1970, 1980, 1990, 2000. This database contains aggregated trade data between countries, i.e. data as they result by summing the single commodity-specific trade exchanges. So we end up with six different, real, asymmetric matrices with entries $m_{ij}^{\text{agg}}(y)$ ($y = 1950, 1960, \dots, 2000$). These adjacency matrix elements are the fundamental data allowing us to obtain all the possible representations of the WTN: to build the binary, directed representation we are interested in here, we restrict ourselves to consider two different vertices as linked, whenever the corresponding element $m_{ij}^{\text{agg}}(y)$ is strictly positive. This implies that the adjacency matrix of the binary, directed representation of the WTN in year $y$ is simply obtained by applying the Heaviside step function to the database entries, i.e. $a_{ij}(y) = \Theta[m_{ij}^{\text{agg}}(y)]$.

Triadic motifs, i.e. all the possible directed patterns connecting three vertices, are the natural generalizations of directed clustering coefficients [12] and the starting point for the understanding of a complex network's self-organization in communities. Thirteen, non-isomorphic, triadic directed patterns can be identified and classified [13]. Given a real, binary, directed matrix $\mathbf{A}^*$, the motifs occurrences $N_m$ can be written in at least two different ways (see Table 1). The first one prescribes to define them in terms of the adjacency matrix entries, $\{a_{ij}\}$. The second one allows to compactly express the coefficients $N_m$ by introducing the following dyadic variables

$$a_{ij} \equiv a_{ij}(1 - a_{ji}), \quad a_{ij}^{\leftarrow} \equiv a_{ji}(1 - a_{ij}), \quad a_{ij}^{\leftrightarrow} \equiv a_{ij}a_{ji}, \quad a_{ij}^{\leftrightarrow} \equiv (1 - a_{ij})(1 - a_{ji}) \quad (10)$$

thus making the role of reciprocity explicit. However, the number of occurrences of the particular motif $m$ (where $m$ ranges from 1 to 13) as measured on the observed network $\mathbf{A}^*$ is uninformative unless a comparison with a properly defined null model is made (see Appendix). This implies that the occurrence of a motif should be compared with its expected value $\langle N_m \rangle^*$, as computed under the chosen null model. This can be compactly achieved by introducing the so-called z-score

$$z[N_m] = \frac{N_m(\mathbf{A}^*) - \langle N_m \rangle^*}{\sigma^*[N_m]} \quad (11)$$

<footnote n="4">⁴ Gleditsch, K.S.: Expanded trade and GDP data. Jour. Confl. Res. 46 (2002) 712–724.</footnote>
<figure><img src="image_3.png" /><figcaption>Fig. 1. The triadic, binary, directed motifs</figcaption></figure>

<table><caption>**Table 1.** Classification (after [13]) and definitions of the triadic motifs</caption><thead><tr><th>Motif m N<sub>m</sub>: 1<sup>st</sup> definition</th><th>N<sub>m</sub>: 2<sup>nd</sup> definition</th></tr></thead><tbody><tr><td>1 &Sigma;<sub>i&ne;j&ne;k</sub>(1 - a<sub>ij</sub>)a<sub>ji</sub>a<sub>jk</sub>(1 - a<sub>kj</sub>)(1 - a<sub>ik</sub>)(1 - a<sub>ki</sub>) &Sigma;<sub>i&ne;j&ne;k</sub>a<sup>&larr;</sup><sub>ij</sub>a<sup>&rarr;</sup><sub>jk</sub>a<sup>&larr;</sup><sub>ik</sub></td><td></td></tr><tr><td>2 &Sigma;<sub>i&ne;j&ne;k</sub>a<sub>ij</sub>(1 - a<sub>ji</sub>)a<sub>jk</sub>(1 - a<sub>kj</sub>)(1 - a<sub>ik</sub>)(1 - a<sub>ki</sub>) &Sigma;<sub>i&ne;j&ne;k</sub>a<sup>&larr;</sup><sub>ij</sub>a<sup>&rarr;</sup><sub>jk</sub>a<sup>&larr;</sup><sub>ik</sub></td><td></td></tr><tr><td>3 &Sigma;<sub>i&ne;j&ne;k</sub>a<sub>ij</sub>a<sub>ji</sub>a<sub>jk</sub>(1 - a<sub>kj</sub>)(1 - a<sub>ik</sub>)(1 - a<sub>ki</sub>) &Sigma;<sub>i&ne;j&ne;k</sub>a<sup>&larr;</sup><sub>ij</sub>a<sup>&rarr;</sup><sub>jk</sub>a<sup>&larr;</sup><sub>ik</sub></td><td></td></tr><tr><td>4 &Sigma;<sub>i&ne;j&ne;k</sub>(1 - a<sub>ij</sub>)(1 - a<sub>ji</sub>)a<sub>jk</sub>(1 - a<sub>kj</sub>)a<sub>ik</sub>(1 - a<sub>ki</sub>) &Sigma;<sub>i&ne;j&ne;k</sub>a<sup>&larr;</sup><sub>ij</sub>a<sup>&rarr;</sup><sub>jk</sub>a<sup>&larr;</sup><sub>ik</sub></td><td></td></tr><tr><td>5 &Sigma;<sub>i&ne;j&ne;k</sub>(1 - a<sub>ij</sub>)a<sub>ji</sub>a<sub>jk</sub>(1 - a<sub>kj</sub>)a<sub>ik</sub>(1 - a<sub>ki</sub>) &Sigma;<sub>i&ne;j&ne;k</sub>a<sup>&larr;</sup><sub>ij</sub>a<sup>&rarr;</sup><sub>jk</sub>a<sup>&larr;</sup><sub>ik</sub></td><td></td></tr><tr><td>6 &Sigma;<sub>i&ne;j&ne;k</sub>a<sub>ij</sub>a<sub>ji</sub>a<sub>jk</sub>(1 - a<sub>kj</sub>)a<sub>ik</sub>(1 - a<sub>ki</sub>) &Sigma;<sub>i&ne;j&ne;k</sub>a<sup>&larr;</sup><sub>ij</sub>a<sup>&rarr;</sup><sub>jk</sub>a<sup>&larr;</sup><sub>ik</sub></td><td></td></tr><tr><td>7 &Sigma;<sub>i&ne;j&ne;k</sub>a<sub>ij</sub>a<sub>ji</sub>(1 - a<sub>jk</sub>)a<sub>kj</sub>(1 - a<sub>ik</sub>)(1 - a<sub>ki</sub>) &Sigma;<sub>i&ne;j&ne;k</sub>a<sup>&larr;</sup><sub>ij</sub>a<sup>&rarr;</sup><sub>jk</sub>a<sup>&larr;</sup><sub>ik</sub></td><td></td></tr><tr><td>8 &Sigma;<sub>i&ne;j&ne;k</sub>a<sub>ij</sub>a<sub>ji</sub>a<sub>jk</sub>a<sub>kj</sub>(1 - a<sub>ik</sub>)(1 - a<sub>ki</sub>) &Sigma;<sub>i&ne;j&ne;k</sub>a<sup>&larr;</sup><sub>ij</sub>a<sup>&rarr;</sup><sub>jk</sub>a<sup>&larr;</sup><sub>ik</sub></td><td></td></tr><tr><td>9 &Sigma;<sub>i&ne;j&ne;k</sub>(1 - a<sub>ij</sub>)a<sub>ji</sub>(1 - a<sub>jk</sub>)a<sub>kj</sub>a<sub>ik</sub>(1 - a<sub>ki</sub>) &Sigma;<sub>i&ne;j&ne;k</sub>a<sup>&larr;</sup><sub>ij</sub>a<sup>&rarr;</sup><sub>jk</sub>a<sup>&larr;</sup><sub>ik</sub></td><td></td></tr><tr><td>10 &Sigma;<sub>i&ne;j&ne;k</sub>(1 - a<sub>ij</sub>)a<sub>ji</sub>a<sub>jk</sub>a<sub>kj</sub>a<sub>ik</sub>(1 - a<sub>ki</sub>) &Sigma;<sub>i&ne;j&ne;k</sub>a<sup>&larr;</sup><sub>ij</sub>a<sup>&rarr;</sup><sub>jk</sub>a<sup>&larr;</sup><sub>ik</sub></td><td></td></tr><tr><td>11 &Sigma;<sub>i&ne;j&ne;k</sub>a<sub>ij</sub>(1 - a<sub>ji</sub>)a<sub>jk</sub>a<sub>kj</sub>a<sub>ik</sub>(1 - a<sub>ki</sub>) &Sigma;<sub>i&ne;j&ne;k</sub>a<sup>&larr;</sup><sub>ij</sub>a<sup>&rarr;</sup><sub>jk</sub>a<sup>&larr;</sup><sub>ik</sub></td><td></td></tr><tr><td>12 &Sigma;<sub>i&ne;j&ne;k</sub>a<sub>ij</sub>a<sub>ji</sub>a<sub>jk</sub>a<sub>kj</sub>a<sub>ik</sub>(1 - a<sub>ki</sub>) &Sigma;<sub>i&ne;j&ne;k</sub>a<sup>&larr;</sup><sub>ij</sub>a<sup>&rarr;</sup><sub>jk</sub>a<sup>&larr;</sup><sub>ik</sub></td><td></td></tr><tr><td>13 &Sigma;<sub>i&ne;j&ne;k</sub>a<sub>ij</sub>a<sub>ji</sub>a<sub>jk</sub>a<sub>kj</sub>a<sub>ik</sub>a<sub>ki</sub> &Sigma;<sub>i&ne;j&ne;k</sub>a<sup>&larr;</sup><sub>ij</sub>a<sup>&rarr;</sup><sub>jk</sub>a<sup>&larr;</sup><sub>ik</sub></td><td></td></tr></tbody></table>

measuring by how many standard deviations, $\sigma^*[N_m]$, the observed and the expected occurrences of motif m differ. Large absolute values of $z[N_m]$ indicate motifs that are either over- or under-represented under the particular null model considered and therefore not explained by the constraints defining it, as shown in Fig.2 and Fig.3 and discussed in the next section.

## 3 Results and Discussion

Fig.2 and Fig.3 show the z-scores for all the 13, triadic, binary, directed motifs, computed for the six different snapshots of the World Trade Network corresponding to the decades 1950, 1960, 1970, 1980, 1990, 2000, for both the DCM and the RCM. We also show the six lines $z = \pm 1$, $z = \pm 2$ and $z = \pm 3$ to highlight the region within 3 sigmas from the expectation value. The analysis reveals a dramatic difference between the predictions of the two null models. The presence of intrinsically directed trading relationships implies that reciprocity is a fundamental quantity, shaping the network of exchanges among world-countries.

The reciprocity of the WTN is known to be very high [10] and this has strong effects on its motif structure. This implies that, in order to reproduce the topology of the network, it is essential to reproduce its dyadic structure, which in turn strongly depends on reciprocity. This also implies that the RCM
<figure><img src="image_4.png" /><figcaption>**Fig. 2.** z-scores of the 13 triadic, binary, directed motifs for the six decades of the WTN, under the DCM (■) and under the RCM (●). The dashed, red lines represent the values $z = \pm 3$, the dotted, purple lines the values $z = \pm 2$ and the dot-dashed, pink lines the values $z = \pm 1$.</figcaption></figure>

should fluctuate less than the DCM, because of this huge amount of additional information. Indeed, this is confirmed by our analysis.

In fact, we find that, unlike other topological properties [4], triadic motifs are systematically not reproduced if only the in-degree and out-degree sequences are taken into account. In particular, the observed motifs counts deviate by up to 100 standard deviations from the expected ones. By contrast, if also the reciprocity (which separately specifies the number of reciprocated links) is introduced in the null model, triadic motifs are almost always consistent with expectations within one standard deviation, as for $m = 5, 10, 11, 12$ or at most two standard deviations, as $m = 1, 4$. Moreover, the significance profiles are almost completely inverted: some of the motifs being over(under)-represented without the reciprocity constraint, as $m = 8$ ($m = 2$), become under(over)-represented with the reciprocity constraint.
<figure><img src="image_5.png" /><figcaption>**Fig. 3.** z-scores of the 13 triadic, binary, directed motifs for the six decades of the WTN, under the DCM (■) and under the RCM (●): zoom of Fig. 2. The dashed, red lines represent the values $z = \pm 3$, the dotted, purple lines the values $z = \pm 2$ and the dot-dashed, pink lines the values $z = \pm 1$.</figcaption></figure>

# 4 Conclusions

The WTN is a particularly interesting network which is known to be driven by a self-organization process involving the global economy. Empirically, it is a very well documented network which allows to test predictions of null models about the key ingredients shaping its topology. In this paper, we aimed at isolating the key properties of the WTN topology where the effects of self-organizations can be clearly detected as deviations from randomness. While the DCM, which takes into account the number of incoming and outgoing connections of all vertices, reproduces many other topological properties, it cannot replicate the observed triadic motifs. On the other hand, we found that the RCM, which also takes into account the numbers of reciprocated links, can replicate almost perfectly the triadic structure. We therefore found that the process underlying the evolu-
tion of the WTN is mainly encoded into the dyadic structure, which carries a large amount of information about the system: so, the upgrade to the RCM is necessary and the possibility to treat the RCM analytically using our method is therefore an important step forward. The result that dyadic properties almost completely explain triadic ones suggests that in the WTN also higher-order properties (e.g. subgraphs of four or more vertices, and in general even the existence of denser communities of vertices) will be explained mostly by dyadic properties. This raises the important question whether the available community detection methods are successful in identifying communities which are not explained by local constraints. In particular, our results suggest that modularity-based community detection methods will detect communities in the WTN if a null model without reciprocity (DCM) is used, while they should find weak or no community structure if a null model including reciprocity (RCM) is used. In both cases, as we have already claimed [5], the available expressions for the modularity (which make the strong assumption of sparse networks) should be revised using the correct expectation values provided by our method, since the WTN is a very dense network. We will address these issues in future work.

## Acknowledgements

This work was supported by the Dutch Econophysics Foundation (Stichting Econophysics, Leiden, The Netherlands) with funds from beneficiaries of Duyfken Trading Knowledge BV, Amsterdam, The Netherlands.

# 5 Appendix

## 5.1 The Directed Configuration Model

Given a real, binary, directed network $\mathbf{A}^*$ with out-degree and in-degree sequences $\mathbf{k}^{\text{out}}(\mathbf{A}^*)$ and $\mathbf{k}^{\text{in}}(\mathbf{A}^*)$, the method described in section 2.1 can be specified in the following way.

*The DCM Hamiltonian.* The Hamiltonian implementing the DCM is

$$H(\mathbf{A}, \alpha, \beta) = \sum_{i} [\alpha_{i} k_{i}^{\text{out}}(\mathbf{A}) + \beta_{i} k_{i}^{\text{in}}(\mathbf{A})] = \sum_{i \neq j} (\alpha_{i} + \beta_{j}) a_{ij} ; \quad (12)$$

the partition function can be calculated as in [8], $Z(\alpha, \beta) = \sum_{\mathbf{A}} e^{-H(\mathbf{A}, \alpha, \beta)} = \prod_{i \neq j} (1 + e^{-\alpha_i - \beta_j})$, and the graph probability is

$$P(\mathbf{A}|\alpha, \beta) \equiv \prod_{i<j} D_{ij}(a_{ij}, a_{ji}|\alpha_i, \alpha_j, \beta_i, \beta_j) = \prod_{i \neq j} p_{ij}^{a_{ij}} (1 - p_{ij})^{(1-a_{ij})} \quad (13)$$

and, by setting $x_i \equiv e^{-\alpha_i}$ and $y_i \equiv e^{-\beta_i}$,

$$p_{ij} = \frac{e^{-\alpha_i - \beta_j}}{1 + e^{-\alpha_i - \beta_j}} \equiv \frac{x_i y_j}{1 + x_i y_j} . \quad (14)$$
The Log-Likelihood Equations. The log-likelihood function to maximize is

$$ \mathcal{L}(\mathbf{x}, \mathbf{y}) = \sum_{i} [k_{i}^{\text{out}}(\mathbf{A}^{*}) \ln x_{i} + k_{i}^{\text{in}}(\mathbf{A}^{*}) \ln y_{i}] - \sum_{i \neq j} \ln(1 + x_{i}y_{j}) \quad (15) $$

and the values $\mathbf{x}^*, \mathbf{y}^*$ corresponding to the point of maximum can be found by solving the following system

$$ \left\{ \begin{array}{ll} k_{i}^{\text{in}}(\mathbf{A}^{*}) = \sum_{j \neq i} \frac{x_{i}^{*} y_{j}^{*}}{1 + x_{i}^{*} y_{j}^{*}} & \forall i \\ k_{i}^{\text{out}}(\mathbf{A}^{*}) = \sum_{j \neq i} \frac{x_{j}^{*} y_{i}^{*}}{1 + x_{j}^{*} y_{i}^{*}} & \forall i \end{array} \right. \quad (16) $$

Expectation Values and Variances. The expectation value and variance of $a_{ij}$ are, respectively, $\langle a_{ij} \rangle^* = p_{ij}^*$ and $(\sigma^*[a_{ij}])^2 = \langle a_{ij} \rangle^*(1 - \langle a_{ij} \rangle^*) = p_{ij}^*(1 - p_{ij}^*)$. Distinct pairs of vertices are independent random variables; since the first definition of the motifs occurrences only involves products of the adjacency matrix entries, their expectation values can be easily computed, as shown in Table 2. The variance of $N_m$ becomes

$$ (\sigma^*[N_m])^2 = \sum_{i,j} \left[ \left( \sigma^*[a_{ij}] \frac{\partial N_m}{\partial a_{ij}} \right)^2_{\mathbf{A}=\langle\mathbf{A}\rangle^*} \right] \quad (17) $$

considering that $\sigma^*[a_{ij}, a_{ji}] = \langle a_{ij}a_{ji} \rangle^* - \langle a_{ij} \rangle^* \langle a_{ji} \rangle^* = 0$.

## 5.2 The Reciprocal Configuration Model

Given a real binary directed network $\mathbf{A}^*$ with directed-degree sequences $\mathbf{k} \to (\mathbf{A}^*)$, $\mathbf{k} \leftarrow (\mathbf{A}^*)$ and $\mathbf{k} \leftrightarrow (\mathbf{A}^*)$ where

$$ k_i \to (\mathbf{A}^*) \equiv \sum_{j \neq i} a_{ij}^*(1 - a_{ji}^*), \quad k_i \leftarrow (\mathbf{A}^*) \equiv \sum_{j \neq i} a_{ji}^*(1 - a_{ij}^*), \quad k_i \leftrightarrow (\mathbf{A}^*) \equiv \sum_{j \neq i} a_{ij}^* a_{ji}^* \quad (18) $$

the randomization procedure can be specified in the following way.

The RCM Hamiltonian. The Hamiltonian implementing the RCM is

$$ H(\mathbf{A}, \alpha, \beta, \gamma) = \sum_{i} [\alpha_{i} k_{i} \to (\mathbf{A}) + \beta_{i} k_{i} \leftarrow (\mathbf{A}) + \gamma_{i} k_{i} \leftrightarrow (\mathbf{A})] , \quad (19) $$

the partition function can be calculated as in [11], $Z(\alpha, \beta, \gamma) = \prod_{i<j} (1 + e^{-\alpha_i - \beta_j} + e^{-\alpha_j - \beta_i} + e^{-\gamma_i - \gamma_j})$, and the graph probability is

$$ \begin{aligned} P(\mathbf{A}|\alpha, \beta, \gamma) &= \prod_{i<j} D_{ij}(a_{ij}, a_{ji}|\alpha_i, \alpha_j, \beta_i, \beta_j, \gamma_i, \gamma_j) \\ &= \prod_{i<j} (p_{ij}^{\alpha_{ij}} p_{\overleftarrow{ij}}^{\beta_{ij}} p_{\overleftrightarrow{ij}}^{\gamma_{ij}} p_{\overleftarrow{ij}}^{\alpha_{\overleftarrow{ij}}} p_{\overleftrightarrow{ij}}^{\beta_{\overleftarrow{ij}}} p_{\overleftarrow{ij}}^{\beta_{\overleftrightarrow{ij}}})^{a_{ij}} \end{aligned} \quad (20) $$
and, by setting $x_i \equiv e^{-\alpha_i}$, $y_i \equiv e^{-\beta_i}$ and $z_i \equiv e^{-\gamma_i}$ [11],

$$p_{ij} \equiv \frac{x_i y_j}{1 + x_i y_j + x_j y_i + z_i z_j}, \quad p_{ij} \equiv \frac{x_j y_i}{1 + x_i y_j + x_j y_i + z_i z_j} \quad (21)$$

$$p_{ij} \equiv \frac{z_i z_j}{1 + x_i y_j + x_j y_i + z_i z_j}, \quad p_{ij} \equiv \frac{1}{1 + x_i y_j + x_j y_i + z_i z_j} \quad (22)$$

**The Log-Likelihood Equations.** The log-likelihood function to maximize is

$$\mathcal{L}(\mathbf{x}, \mathbf{y}, \mathbf{z}) = \sum_i [k_i \stackrel{\leftarrow}{\to} (\mathbf{A}^*) \ln x_i + k_i \stackrel{\leftarrow}{\to} (\mathbf{A}^*) \ln y_i + k_i \stackrel{\leftarrow}{\to} (\mathbf{A}^*) \ln z_i] \\ - \sum_{i<j} \ln(1 + x_i y_j + x_j y_i + z_i z_j) \quad (23)$$

and the values $\mathbf{x}^*, \mathbf{y}^*, \mathbf{z}^*$ corresponding to the point of maximum can be found by solving the following system

$$\left\{
\begin{array}{ll}
k_i \stackrel{\leftarrow}{\to} (\mathbf{A}^*) = \sum_{j \neq i} \frac{x_i^* y_j^*}{1+x_i^* y_j^* + x_j^* y_i^* + z_i^* z_j^*} & \forall i \\
k_i \stackrel{\leftarrow}{\to} (\mathbf{A}^*) = \sum_{j \neq i} \frac{x_j^* y_i^*}{1+x_i^* y_j^* + x_j^* y_i^* + z_i^* z_j^*} & \forall i \\
k_i \stackrel{\leftrightarrow}{\to} (\mathbf{A}^*) = \sum_{j \neq i} \frac{z_i^* z_j^*}{1+x_i^* y_j^* + x_j^* y_i^* + z_i^* z_j^*} & \forall i
\end{array}
\right.
\quad (24)$$

**Expectation Values and Variances.** The expectation value and variance of $a_{ij} \stackrel{\leftrightarrow}{\to}$ (and equivalently for the other dyadic variables) are, respectively, $\langle a_{ij} \stackrel{\leftrightarrow}{\to} \rangle^* = (p_{ij} \stackrel{\leftrightarrow}{\to})^*$ and $(\sigma^*[a_{ij} \stackrel{\leftrightarrow}{\to}])^2 = \langle a_{ij} \stackrel{\leftrightarrow}{\to} \rangle^*(1 - \langle a_{ij} \stackrel{\leftrightarrow}{\to} \rangle^*) = (p_{ij} \stackrel{\leftrightarrow}{\to})^*(1 - (p_{ij} \stackrel{\leftrightarrow}{\to})^*)$. Considering that two distinct dyads can be treated as independent random variables and that the second definition of the motifs occurrences only involves products of dyads, their expectation values can be easily computed, as shown in Table 2. The variance of $N_m$ becomes

$$(\sigma^*[N_m])^2 = \sum_{i,j} \left[ \left( \sigma^*[a_{ij}] \frac{\partial N_m}{\partial a_{ij}} \right)^2_{\mathbf{A}=\langle\mathbf{A}\rangle^*} + \sigma^*[a_{ij}, a_{ji}] \left( \frac{\partial N_m}{\partial a_{ij}} \frac{\partial N_m}{\partial a_{ji}} \right)_{\mathbf{A}=\langle\mathbf{A}\rangle^*} \right] \quad (25)$$

where now $(\sigma^*[a_{ij}])^2 = \langle a_{ij} \stackrel{\leftrightarrow}{\to} + a_{ij} \stackrel{\leftrightarrow}{\to} \rangle^* (1 - \langle a_{ij} \stackrel{\leftrightarrow}{\to} + a_{ij} \stackrel{\leftrightarrow}{\to} \rangle^*)$ and $\sigma^*[a_{ij}, a_{ji}] = \langle a_{ij} \stackrel{\leftrightarrow}{\to} \rangle^* - \langle a_{ij} \stackrel{\leftrightarrow}{\to} + a_{ij} \stackrel{\leftrightarrow}{\to} \rangle^* \langle a_{ji} \stackrel{\leftrightarrow}{\to} + a_{ji} \stackrel{\leftrightarrow}{\to} \rangle^*.$

## References

1. Garlaschelli, D., Loffredo, M.I.: Fitness-dependent topological properties of the World Trade Web. Phys. Rev. Lett. 93 (2004) 188701

2. Garlaschelli, D., Di Matteo, T., Aste T., Caldarelli, G., Loffredo, M.I.: Interplay between topology and dynamics in the World Trade Web. Eur. Phys. J. B 57 (2007) 159-164
<table><caption>**Table 2.** Expectation values of the triadic motifs</caption><thead><tr><th>Motif m &lang;N<sub>m</sub>&rang;DCM</th><th>&lang;N<sub>m</sub>&rang;RCM</th></tr></thead><tbody><tr><td>1</td><td>&sum;<sub>i&ne;j&ne;k</sub>(1 &minus; p<sub>ij</sub>)p<sub>ji</sub>p<sub>jk</sub>(1 &minus; p<sub>kj</sub>)(1 &minus; p<sub>ik</sub>)(1 &minus; p<sub>ki</sub>) &sum;<sub>i&ne;j&ne;k</sub>p<sub>ij</sub>p<sub>jk</sub>p<sub>ik</sub></td></tr><tr><td>2</td><td>&sum;<sub>i&ne;j&ne;k</sub>p<sub>ij</sub>(1 &minus; p<sub>ji</sub>)p<sub>jk</sub>(1 &minus; p<sub>kj</sub>)(1 &minus; p<sub>ik</sub>)(1 &minus; p<sub>ki</sub>) &sum;<sub>i&ne;j&ne;k</sub>p<sub>ij</sub>p<sub>jk</sub>p<sub>ik</sub></td></tr><tr><td>3</td><td>&sum;<sub>i&ne;j&ne;k</sub>p<sub>ij</sub>p<sub>ji</sub>p<sub>jk</sub>(1 &minus; p<sub>kj</sub>)(1 &minus; p<sub>ik</sub>)(1 &minus; p<sub>ki</sub>) &sum;<sub>i&ne;j&ne;k</sub>p<sub>ij</sub>p<sub>jk</sub>p<sub>ik</sub></td></tr><tr><td>4</td><td>&sum;<sub>i&ne;j&ne;k</sub>(1 &minus; p<sub>ij</sub>)(1 &minus; p<sub>ji</sub>)p<sub>jk</sub>(1 &minus; p<sub>kj</sub>)p<sub>ik</sub>(1 &minus; p<sub>ki</sub>) &sum;<sub>i&ne;j&ne;k</sub>p<sub>ij</sub>p<sub>jk</sub>p<sub>ik</sub></td></tr><tr><td>5</td><td>&sum;<sub>i&ne;j&ne;k</sub>(1 &minus; p<sub>ij</sub>)p<sub>ji</sub>p<sub>jk</sub>(1 &minus; p<sub>kj</sub>)p<sub>ik</sub>(1 &minus; p<sub>ki</sub>) &sum;<sub>i&ne;j&ne;k</sub>p<sub>ij</sub>p<sub>jk</sub>p<sub>ik</sub></td></tr><tr><td>6</td><td>&sum;<sub>i&ne;j&ne;k</sub>p<sub>ij</sub>p<sub>ji</sub>p<sub>jk</sub>(1 &minus; p<sub>kj</sub>)p<sub>ik</sub>(1 &minus; p<sub>ki</sub>) &sum;<sub>i&ne;j&ne;k</sub>p<sub>ij</sub>p<sub>jk</sub>p<sub>ik</sub></td></tr><tr><td>7</td><td>&sum;<sub>i&ne;j&ne;k</sub>p<sub>ij</sub>p<sub>ji</sub>(1 &minus; p<sub>kj</sub>)p<sub>kj</sub>(1 &minus; p<sub>ik</sub>)(1 &minus; p<sub>ki</sub>) &sum;<sub>i&ne;j&ne;k</sub>p<sub>ij</sub>p<sub>jk</sub>p<sub>ik</sub></td></tr><tr><td>8</td><td>&sum;<sub>i&ne;j&ne;k</sub>p<sub>ij</sub>p<sub>ji</sub>p<sub>jk</sub>p<sub>kj</sub>(1 &minus; p<sub>ik</sub>)(1 &minus; p<sub>ki</sub>) &sum;<sub>i&ne;j&ne;k</sub>p<sub>ij</sub>p<sub>jk</sub>p<sub>ik</sub></td></tr><tr><td>9</td><td>&sum;<sub>i&ne;j&ne;k</sub>(1 &minus; p<sub>ij</sub>)p<sub>ji</sub>(1 &minus; p<sub>jk</sub>)p<sub>kj</sub>p<sub>ik</sub>(1 &minus; p<sub>ki</sub>) &sum;<sub>i&ne;j&ne;k</sub>p<sub>ij</sub>p<sub>jk</sub>p<sub>ik</sub></td></tr><tr><td>10</td><td>&sum;<sub>i&ne;j&ne;k</sub>(1 &minus; p<sub>ij</sub>)p<sub>ji</sub>p<sub>jk</sub>p<sub>kj</sub>p<sub>ik</sub>(1 &minus; p<sub>ki</sub>) &sum;<sub>i&ne;j&ne;k</sub>p<sub>ij</sub>p<sub>jk</sub>p<sub>ik</sub></td></tr><tr><td>11</td><td>&sum;<sub>i&ne;j&ne;k</sub>p<sub>ij</sub>(1 &minus; p<sub>ji</sub>)p<sub>jk</sub>p<sub>kj</sub>p<sub>ik</sub>(1 &minus; p<sub>ki</sub>) &sum;<sub>i&ne;j&ne;k</sub>p<sub>ij</sub>p<sub>jk</sub>p<sub>ik</sub></td></tr><tr><td>12</td><td>&sum;<sub>i&ne;j&ne;k</sub>p<sub>ij</sub>p<sub>ji</sub>p<sub>jk</sub>p<sub>kj</sub>p<sub>ik</sub>(1 &minus; p<sub>ki</sub>) &sum;<sub>i&ne;j&ne;k</sub>p<sub>ij</sub>p<sub>jk</sub>p<sub>ik</sub></td></tr><tr><td>13</td><td>&sum;<sub>i&ne;j&ne;k</sub>p<sub>ij</sub>p<sub>ji</sub>p<sub>jk</sub>p<sub>kj</sub>p<sub>ik</sub>p<sub>ki</sub> &sum;<sub>i&ne;j&ne;k</sub>p<sub>ij</sub>p<sub>jk</sub>p<sub>ik</sub></td></tr></tbody></table>

3. Garlaschelli, D., Capocci, A., Caldarelli, G.: Self-organized network evolution coupled to extremal dynamics. Nat. Phys. **3** (2007) 813-817

4. Squartini, T., Fagiolo, G., Garlaschelli, D.: Randomizing world trade. I. A binary network analysis. Phys. Rev. E **84** (2011) 046117

5. Squartini, T., Garlaschelli, D.: Analytical maximum-likelihood method to detect patterns in real networks. New J. Phys. **13** (2011) 083001

6. Maslov, S., Sneppen, K., Zaliznyak, A.: Detection of topological patterns in complex networks: correlation profile of the Internet. Physica A **333** (2004) 529-540

7. Holland, P., Leinhardt, S.: Sociological Methodology. Jossey-Bass, San Francisco (1975) 1-45

8. Park, J., Newman, M.E.J.: Statistical mechanics of networks. Phys. Rev. E **70** (2004) 066117

9. Garlaschelli, D., Loffredo, M.I.: Maximum likelihood: extracting unbiased information from complex networks. Phys. Rev. E **78** (2008) 015101(R)

10. Garlaschelli, D., Loffredo, M.I.: Patterns of link reciprocity in directed networks. Phys. Rev. Lett. **93** (2004) 268701

11. Garlaschelli, D., Loffredo, M.I.: Multispecies grand-canonical models for networks with reciprocity. Phys. Rev. E **73** (2004) 015101(R)

12. Fagiolo, G.: Clustering in complex directed networks. Phys. Rev. E **76** (2007) 026107

13. Caldarelli, G.: Scale-free Networks. Complex Webs in Nature and Technology. Oxford University Press, Oxford (2007) 35-38