A complex network framework for the efficiency and resilience trade-off in global food trade

Global food trade is crucial for food security and availability. Trade is typically optimized to promote efficiency, whereas resilience is increasingly being recognized as another important objective. However, it is not clear if prioritizing resilience comes at the expense of efficiency or if the two objectives can be promoted simultaneously. We develop a complex network framework to assess the relationship between efficiency and resilience of food trade for the last half century. There is a competitive relationship between efficiency and resilience when only network topology is considered. However, a cooperative relationship between efficiency and resilience exists when the intensity of trade connections is accounted for. Policy makers can use this framework to evaluate the relationship between efficiency and resilience in critical supply chains.


Introduction
Global food trade is a critical part of our modern food system [1,2]. Food trade enables nations around the world to specialize in producing agri-food commodities for which they have a comparative advantage [3] to meet the diverse demands of consumers in distant locations [4,5]. Investments in transportation infrastructure and trade agreements have helped to increase the connectivity between nations over the last several decades [6] to promote efficiency [7]. However, it is not clear if the efficiency gains that have been obtained through increased connectivity of global trade enhance or detract from its resilience. Higher connectivity may enable consumers to access food from a variety of sources in the event that a major exporter is disrupted [8,9]. Alternatively, connectivity may enable production shocks and export restrictions to be transmitted to importers [10]. Even though efficiency and resilience are two important objectives of any supply chain, we do not understand how these two goals interact with one another in food trade networks. This study seeks to determine if efficiency and resilience in food trade networks are competitive or cooperative goals.
Complex network methods can be used to understand resilience in an increasingly interconnected world facing growing threats from natural hazards, malevolent attacks, economic shocks and pandemics [11][12][13]. Previous studies of network efficiency and resilience have not accounted for the intensity of connections [14], which is an important aspect of food trade due to high heterogeneity in mass flux between nations [15,16]. Additionally, it is important to determine resilience of food trade to two major threats: spreading risk and disruption to a major exporting nation. Most studies of the resilience of food trade consider a single threat [9,10]. Here, we evaluate food trade resilience to both spreading risk (e.g. contamination among food commodities from a food-borne pathogen) and targeted node attack (e.g. the most important food exporter, both for connections and mass, is 'knocked out' of the trade system, such as from a malevolent cyber attack) [17][18][19].
The complete removal of the major exporter from the global food trade network is an extreme scenario, yet one that is increasingly necessary to consider. National defense agencies suggest that scenarios in which entire nations are knocked out of the trade system, due to malevolent cyber attacks, are within the realm of possibility [20]. These attacks could incapacitate machinery and computer systems involved in agricultural production, harvest, transport, food manufacturing, inventory control and market information. In 2011, extreme drought led Russia (the second-largest wheat exporter) to impose a complete export ban on wheat [21]. During the global COVID-19 pandemic, over 20 nations imposed border shutdowns and export bans on agrifood commodities [22], including Cambodia and Myanmar, who imposed a complete export ban on rice [23]. These examples highlight that the complete removal of a nation from global trade-although extreme-is plausible.
In this study, we consider efficiency and resilience from a complex network perspective and do not explicitly consider economic aspects. This means that our approach captures the physical network structure of food trade related to the logistics of producing, processing and transporting agri-food commodities around the globe. Previous studies have applied network analysis to food trade. However, studies of food trade networks to date either assess only resilience or efficiency, rather than the relationship between these two important objectives. Tu et al [24] studied the relationship between resilience, network connectedness and resource use. Distefano et al [25] analyzed resilience against export quantity drops in global staple trade. Fair et al [26] predicts the resilience of global wheat trade to targeted and random link removals. Gephart et al [27] studied resilience of fish trade against changes in supply levels. D'Odorico et al [28] analyzed the water use efficiency and connectivity of food trade. Ercsey-Ravasz et al [10] studied the risk of contamination among food commodities through international trade by node-level analysis, while we assess the effects of the complete network structure over spread risk.
We present a comprehensive statistical network framework to assess the trade-off between food trade efficiency and resilience. To our knowledge, this is the first study to quantify the relationship between food trade efficiency and resilience in a way that accounts for both the topological structure and the heterogeneous distribution of trade intensities (see table 6 in the supplementary information (SI), available online at stacks.iop.org/ERL/16/105003/mmedia; the SI provides an in-depth literature review and comparison with prior studies). The following questions guide this study: (a) Is there a trade-off between efficiency and resilience in topological food trade networks? (b) How does the efficiency and resilience trade-off in food trade networks compare with theoretical networks? (c) How does this relationship change when trade intensities are accounted for? (d) How does food trade efficiency and resilience change with time? To answer these questions, we use the COMTRADE database to evaluate real-world empirical networks of global food trade from 1965 to 2018 for the full spectrum of empirical food trade networks, from the trade of individual commodities to the entirety of agri-food. We also generate a suite of theoretical and null-model networks to compare against.

Methods
We develop a statistical complex network framework to assess the relationship between efficiency and resilience. We both adopt existing metrics from the literature and introduce novel ones. All of the metrics focus on the existing repeat movement (re-exports and re-imports of food flows) in the global food trade while measuring efficiency and resilience. We use the average shortest path length,d, for topological network efficiency and the epidemic threshold, τ , for topological resilience to contaminant spread among food commodities. We introduce the change in the dominant eigenvalue,λ, to evaluate the resilience of topological networks to targeted removal of the nation with the largest number of export connections. We present a new metric that captures the efficient usage of the trade connections in terms of mass transport. Specifically, we introduce E(Γ) to measure the inverse of the total weight [ton] being transmitted through the shortest paths. We introduce R(Γ) to quantify resilience to targeted removal of the major mass exporter. R(Γ) is defined to be the remaining portion of mass in the network after the mass of the largest exporter is removed. A summary table of all metrics used in this study is provided in table 1.
To build up our understanding of these metrics, we numerically generate a suite of well-studied theoretical networks (e.g. star, scale-free, random, ring topologies) with multiple weight distributions (unweighted, extreme, power-law, normal, uniform weight distributions). We then apply these metrics to trade data for a variety of agri-food commodities (e.g. grain, meat, vegetables and fruits, and representative individual commodities). Empirical data is collected from 1965 to 2018 for every year to evaluate how the network structure has changed with time. We also generate null-model statistical networks for realistic benchmarks. Table 2 lists all networks included in this study.

Empirical trade data
The COMTRADE database provides information on the bilateral trade between nations for all agricultural and food commodities in units of mass and value [29]. The real-world food trade data from COMTRADE is used to construct the empirical networks in our analysis. We collect and analyze trade data for the following agri-food commodities: (a) aggregated food categories -'grain' , 'meat' and 'vegetables and fruits'; (b) major individual commoditieswheat, rice, maize and soy from 'grain'; beef, chicken, pork and fish from 'meat'; and tomato, potato, apple and banana from 'vegetables and fruits'; and (c) total agri-food-the sum of all agricultural and food commodities. Refer to table 9 in SI for the list of trade data considered. Figure 1(A) provides maps of all aggregated food commodity exports for each country in the year 2018 in units of tons. The United States exports the most 'grain' , 'meat' and 'total agri-food' among all countries.
Data is collected from 1965 to 2018 for each year. Figure 1(B) presents graphs of the total trade in all aggregated food commodities over the study time period broken down by major category. Grain is the largest traded category in terms of total mass. Commodities in the COMTRADE database are coded by the Standard International Trade Classification (SITC). More information on the raw and processed COMTRADE data is included in SI.
We represent the global food trade as a flow network where a node is assigned to each nation and a directed link is assigned to each trade relationship. We consider both exports and imports of commodities, and the direction of links is structured from exporter to importer. The directed network is non-symmetric. Data on re-exports and re-imports are also incorporated. For any re-export, we introduce (a) a directed link from the producer to intermediate stop and (b) another directed link from the intermediate stop to final customer. For example, if the producer nation 'A' first exports the goods to intermediate nation 'B' and then nation 'B' re-exports the same commodity to final consumer nation 'C' , we introduce two links into the network. First directed link is from nation 'A' to 'B' , and the second one is from nation 'B' to 'C' . By including the re-exports and re-imports, we capture intermediate movement of goods in the food trade network.

Topological efficiency and resilience metrics
The link-based average shortest path length of the network is used to quantify topological efficiency. This is a commonly preferred unitless network distance metric, as it enables the efficiency of network connections to be determined with only topological characteristics [30][31][32]. We used to quantify topological efficiency:d (1) where N is the number of nodes in the network and d ij is the link-based shortest path (i.e. smallest number of jumps) between nodes i and j computed by Dijkstra's algorithm [33]. Biggerd values represent more jumps between any two nodes in the network. Asd gets closer to 1, it represents a more efficient network since each node is connected to every other node with   [34].
Each link in the global food trade network indicates an additional transit through a foreign country. Each new border crossing represents additional time due to loading and unloading processes, as well as additional customs and border paperwork and fees. This would be particularly problematic for perishable goods, in which time delays could lead to food loss and waste, and any extra refrigeration required during transit represents additional energy requirements. So, additional border crossings indicate less efficiency in the network. Hence, having a lower average shortest path length, i.e. lower number of intermediate stops on average, would represent a more efficient flow network [34,35]. Importantly, note that we focus on complex network efficiency rather than economic efficiency, which typically measures price, in which additional border crossings may or may not enable supply chains to achieve lower prices.
We evaluate the topological resilience of food trade networks to targeted node attack. Targeted node attack and complete removal is a common approach to evaluate supply chain resilience [36]. We consider targeted removal of the major exporter (i.e. the country with the most export links) in order to represent a supply disruption [37]. The definition that we use is agnostic as to the cause of the node-scale removal, but which could occur due to a large shock in that nation's climate or socio-political system, e.g. due to a stochastic weather event or malevolent attack by an adversary. In this way, we determine the dependence of the food trade system on the removal of the key exporter in the network.
To quantify resilience to targeted attack, we introduce a new resilience metric,λ.λ quantifies network reliance on the nation that has the largest number of export connections. Our approach incorporates eigenvalues of the adjacency matrix, which many prior studies have also used to assess resilience [38][39][40][41][42][43]. Our metric,λ, is distinct to prior resilience metrics, in that it best captures resilience to targeted attack in trade networks.λ computes Figure 1. Graphs of COMTRADE food trade data used in this study. Map of mass export [ton] by country for total (A) agri-food, (C) meat, (E) vegetables and fruits, and (G) grain for the year 2018. The United States is the largest mass exporter of all agri-food and exports 2.34E+08 tons. The United States is the major exporter of meat with a total export of 8.73E+06 tons. Spain is the major mass exporter of vegetables and fruits with a total export of 1.44E+07 tons. The United States is the major mass exporter of grain with a total export of 1.52E+08 tons. Time series of total (B) agri-food, (D) meat, (F) vegetables and fruits, and (H) grain trade from 1965 to 2018. Trade by major food category is also provided. the percentage change in the dominant eigenvalue of the directed network adjacency matrix when the node with highest out degree is removed from the graph:λ where λ 1 is the dominant eigenvalue of the square adjacency matrix of the original directed network (i.e. all nodes are included in the graph). λ ′ 1 is the new dominant eigenvalue of the square adjacency matrix of the directed network after removing its highest out degree node, (both the corresponding row and column are removed from the adjacency matrix).λ is the percentage change in the dominant eigenvalue of the directed network after removal of the node with the highest out degree.λ can be implemented on both directed and undirected networks without loss of generality.
The dominant eigenvalue of the adjacency matrix represents the spectral radius of the network [44]. The spectral radius is correlated with node degree variations [45]. Network topologies with higher degree variations have higher dominant eigenvalues whereas topologies with lower degree variations have lower dominant eigenvalues. Coreperiphery topologies have higher degree variations and lattice-like topologies have lower degree variations. Hence, under the same network size and density, core-periphery topologies have higher dominant eigenvalues whereas lattice-like topologies have lower dominant eigenvalues.
Importantly, repetitive flow transmissions between nodes is captured by the dominant eigenvalue of the adjacency matrix [46]. The dominant eigenvalue of the adjacency matrix is bounded by network connectivity (see SI for more detailed discussion). As network topologies that have higher connectivity would enable more frequent repeat movements, they will have higher dominant eigenvalues. As network topologies that have lower connectivity would enable less frequent repeat movements, they will have lower dominant eigenvalues [47]. Hence, dominant eigenvalue of the adjacency matrix represents the ability of repeat transmission in the network based on its topology [48], i.e. branching of the network structure [49].
A higher percentage change in the dominant eigenvalue indicates the network has a greater dependence on the removed node for the flow transmission. A lowerλ indicates networks that are more resilient to the threat of targeted node removal, as their flow propagation is less affected from the removal of the node with highest out degree.
For targeted node removal in unweighted networks, we consider the largest supplier of trade connections which stands for the node with highest out degree in the food trade network [50][51][52][53]. As degree is one of the most common node centrality measures [54,55], this approach represents the worst-case scenario in terms of node removal which is a common supply chain network resilience assessment [34].
We also consider spreading risk of a food borne disease among food commodities. To assess the resilience of the network to spreading risk, we use the epidemic threshold metric, τ . τ is also based on the dominant eigenvalue of the unweighted network and provided in equation (3) as: where λ 1 is the dominant eigenvalue of the original directed adjacency matrix and τ is the epidemic threshold. τ has been used as a measure of resilience against spreading risk in graph theory [56][57][58], such as virus spread in internet networks [59][60][61]. Similar to internet networks, food trade can also be characterized with repeat movements of flow between nodes. Hence, in food trade among the re-export and re-import processes, any food-borne disease that starts in one country can spread through trade. If the value of network dominant eigenvalue is small, then threshold for any disease to become an epidemic τ is higher. This is because the network connectivity and its ability to transmit flow is lower. So, the probability that the disease will die out before it contaminates the majority of the network is higher (i.e, likely will not turn into an epidemic). On the other hand, if the value of network dominant eigenvalue is large, then the threshold for observing an epidemic τ is low. This means that passing the epidemic threshold is easier and there is a higher chance for a disease to become an epidemic in the network, since network connectivity and its flow transmission ability is higher.
For example, core-periphery structures have higher connectivity than lattice-like structures. Therefore, (under the same network density) the dominant eigenvalue of the core-periphery topologies are higher than lattice-like topologies. This means that the epidemic threshold is lower for core-periphery structures than it is for lattice-like structures. Hence, the probability of a locally borne disease contaminating the network is higher in core-periphery structures. On the other hand, as the dominant eigenvalues of lattice-like topologies are lower, they have higher epidemic thresholds. Hence, the probability of a locally borne disease contaminating the network is lower in lattice-like structures [62].

Weighted efficiency and resilience metrics
Weighted efficiency and resilience metrics explicitly account for trade intensity of arcs (and not just topology). The weighted efficiency and resilience metrics directly build on the unweighted metrics but with explicit consideration of mass. We develop a new metric to quantify the weighted efficiency of trade networks. Our weighted efficiency metric, E(Γ), captures the efficient usage of the trade connections in terms of mass transport. This is distinct to other flow-based efficiency metrics in the literature [63,64], which usually incorporate the cost or distance of transport as the link weights. However, existing metrics do not explicitly consider the efficient allocation of mass flux to shortest paths in the network. With this goal in mind, we build ond by using link-based shortest paths, but now also consider the allocation of mass to paths.
Weighted efficiency, E(Γ), is formulated as: where w ij is the total weight [ton] being transmitted through the link-based shortest path, d ij , from node i to j. E(Γ) is an inversely weighted shortest path measure since mass is in the denominator and shortest path length is in the numerator. Network efficiency increases as the value of E(Γ) decreases. This is because E(Γ) becomes smaller as greater mass is transmitted through shortest paths. Conversely, as E(Γ) increases the efficiency of the network declines.
This means that the shortest paths in trade networks should be allocated greater quantities of mass in order to achieve lower values of E(Γ), i.e. higher efficiency. A simple representation of how E(Γ) works at both the link and network-level is illustrated in figure 10 in SI. Our weighted resilience metric builds uponλ, in that targeted removal of the most important exporter is again considered. Weighted resilience, R(Γ), quantifies the reliance of the network on the largest mass supplier nation. Specifically, R(Γ) calculates the mass remaining in the trade system after the largest mass exporter is eliminated: where W i out is the mass export of each nation i and max(W out ) is the total quantity of mass exported by the largest mass exporter. Larger values of R(Γ) indicate that the mass of the food trade network is less reliant on the major mass exporter, which means the network has higher weighted resilience. Smaller values of R(Γ) indicate the food trade network has greater reliance on the major mass exporter for the mass available to the trade system, or that the network is less resilient to targeted removal of this node. Hence, the dependence of the food trade network on a single nation in terms of the supply amount [in tons] is quantified by R(Γ). The countries that are removed to calculate R(Γ) in empirical networks are shown in figure 1 (e.g. the largest mass exporter by food category). Note that only resilience to mass flux disruption is considered, as spread risk is mainly based on topology.

Theoretical and null-model comparison networks
We construct theoretical and null-model networks to better understand the performance of the efficiency and resilience metrics. Using theoretical networks as reference points to the empirical network of study is a common approach in the literature [65,66]. For example, Rodríguez-Iturbe and Rinaldo [67] considered star and ring topologies as a comparison point for the fractal structure of river basins. Tu et al [24] adopted the Erdös-Rényi model as a reference point for global food trade modularity and interconnectedness. Fair et al [26] analyzed scale-free network statistics as a comparison point for global wheat trade. Similarly, Popp et al [68] examined scale-free network clustering as a reference point for global honey trade.
We generate two extreme theoretical networks (i.e. ring and star) and two more moderate networks (i.e. random and scale-free). Random networks are generated according to the Erdös-Rényi model; scale-free networks are generated based on the Barabási-Albert model. Core-periphery networks are known to prioritize efficiency, while lattice-like networks prioritize resilience [69] (see figure 2). For this reason, values ofd,λ and τ in the ring and star networks provide the upper and lower bounds of the envelope for the empirical food trade results, since these theoretical networks represent extremes in terms of efficiency and resilience (see figure 3). The random and scale-free networks provide a more moderate reference point for values ofd,λ and τ .
Null-models provide a more realistic benchmark for trade networks [70,71]. One can generate the randomized version of the empirically-observed networks by keeping certain topological characteristics fixed with null-models [72]. The node degree distribution is one of the most critical topological characteristics as it is enough to predict other highorder network statistics [73]. Hence, we generate nullmodel networks for empirical food trade networks by keeping the node degree distributions fixed. For year 2018, we use null-model estimations to compare the observed topological efficiency and resilience of each food commodity. Table 2 provides a summary of the theoretical, null, and empirical networks considered. Figure 2 providesd,λ and τ for both theoretical and empirical networks. Networks with a more defined core-periphery structure (i.e. star and scalefree networks) have greater efficiency (e.g. smalld; see figure 2(A)), which is consistent with the literature [69]. However, the structure of these networks is dependent on core nodes, so their resilience against the removal of the core nodes is low (e.g. highλ; see figure 2(B)). Also, these networks are vulnerable to spread risk since contamination in the core node could rapidly transmit an epidemic in the whole network (e.g. low τ ; see figure 2(C)). Conversely, networks with a lattice-like structure (i.e. random and ring graphs) have high resilience due to the absence of a core node (e.g. lowλ; see figure 2(B)). Lattice-like networks have normal and uniform degree distributions (see figure 3), so there is no superspreader node to contaminate the whole network. However, the average shortest path lengths of lattice-like networks are relatively high, as multiple jumps are required to establish a connection between any two nodes (e.g. highd; see figure 2(A)). So, lattice-like network structures have low efficiency.

Topological network efficiency and resilience
Numerical findings illustrate that there is a competitive relationship between efficiency (d) and resilience (for bothλ and τ ) when density is held constant (see figures 11 and 12 in the SI). As density increases the numerical metrics converge, indicating that differences between types of networks fade as networks (C) Resilience against spread risk is measured with the epidemic threshold, τ . The envelope of potential outcomes is shown by the area between ring and star networks. Lattice-like topologies (i.e. ring and random networks) have higher average shortest paths but lower change in dominant eigenvalues as well as higher epidemic thresholds. Core-periphery topologies (i.e. star and scale-free networks) have lower average shortest path values but higher change in dominant eigenvalues as well as lower epidemic thresholds. Numerical results are average of 1000 generated networks for each density and topology. Food trade data is shown with the black diamonds. become dense (see figure 2). Network density is the fraction of existing links to the number of links that could exist in the graph (refer to equation (12) in the SI). Empirical networks (i.e. food trade networks created with data from COMTRADE) exist across the range of densities (see black points in figure 2). Empirical networks that have relatively high densities usually perform worse inλ,d and τ when compared with the scale-free networks. In scale-free networks, multiple hubs exist that are connected to almost all the nodes in the periphery. However, empirical networks have a higher number of hubs which are not connected to all nodes in the periphery. This leads scale-free networks to be more efficient than empirical networks (i.e. smaller average shortest path,d, in small-world networks). Also,λ is smaller in scale-free networks, as when one hub is removed the remaining (smaller) hubs connect the rest of the nodes in the network. Scale-free networks also have fewer potential disease superspreaders, so they perform better in τ than empirical networks.
Food trade network values fall within the range of null-model results in most cases (see figure 4). Values ofd are generally on the upper-end of the range (see figure 4(A)) whileλ values fall on the lowerend of the estimation range (see figure 4(B)). The range of expected values for each metric narrows with increased density. Individual food commodities are sparser and their null-model ranges show higher variation. This is because sparse networks are more sensitive to changes to a single connection. Null-model findings compliment theoretical results. Both theoretical and null-model comparisons highlight the important role of the degree distribution in shaping topological efficiency and resilience. Null-model results provide a more realistic benchmark to global trade, although the random rewiring may not share a resemblance with the real-world countries or trade links represented by the data. The theoretical networks provide insight into the performance of the metrics in unrealistic (in terms of trade) but wellstudied networks. Null-model and theoretical network findings compliment each other and enhance our framework.

Competition parameters for unweighted networks
The competitive relationship between efficiency and resilience is a function of network density (see figure 5). The competition between efficiency and resilience to node removal becomes weaker as density increases. As more connections are made in the network the average shortest path length decreases (e.g.d gets smaller, efficiency increases). With greater density, the network relies less on a single node, as there are multiple nodes with high out-degree to maintain network structure. This means that both efficiency and resilience to node removal increase as the network becomes more connected. The ultimate case is for a complete network with density equal to one. For a complete network, both the efficiency and the resilience against node removal are optimized by the network. However, the competition between efficiency and resilience to spread risk grows stronger as the network density increases. This is because τ declines with density, which means the chance of a disease dying out decreases as all nodes are connected with one another. Here, a complete network would have the best efficiency but the lowest resilience against an epidemic, since every node is a candidate for spreading the disease throughout the network.
We introduce a scheme to assess the competition between efficiency and resilience. Figure 3 presents the competition parameters for topological networks and how they relate toλ,d and τ . We formulate two competition parameters in equations (6) and (7), which can be used to locate networks on the competition scale.
The first competition parameter, α, is formulated in equation (6) to quantify the competition between topological efficiency and resilience in terms of the reliance on a single node to propagate flow. The second competition parameter, β, is formulated in equation (7) to quantify the competition between topological efficiency and resilience against foodborne disease spread in the network. Both competition parameters range from 0 to 1, with 0 indicating the most resilient network and 1 indicating the most efficient network. In lattice-like topologies (i.e. random and ring networks) gains in efficiency overpower the gains in resilience against node removal as density increases (see figure 5(A)). Lattice-like values of α are smaller for low densities and increase to 0.5 with increased density. Conversely, the gains in resilience against node removal overpower the efficiency gains in coreperiphery topologies (i.e. star and scale-free networks) as density increases. Core-periphery values of α start close to 1 and go down to 0.5 with increased density (i.e. α moves from efficient to balanced). This indicates that the competition betweend and λ softens with increased network density. As density increases, both lattice-like and core-periphery topologies become more efficient, yet more vulnerable (i.e. less resilient) to spread risk. Figure 5(B) plots the competition parameter, β, which increases towards 1 across all networks as density increases. Thus, β sharpens with density. As density increases, different network topologies become more similar, as do their efficiency and resilience values. Therefore, the range of the competition parameters α and β decreases with density (see figure 13 in SI).
Empirical food trade networks are similar to scale-free networks for α. At low densities, empirical values of α fall between random and scale-free networks. The low-density empirical food trade networks have multiple hubs but not as many as scalefree networks. As density increases, scale-free networks gain more hubs, so their gains in resilience exceeds the gains in resilience of empirical food trade networks. However, around a density of 0.1 no new hubs are introduced in scale-free networks, such that empirical food trade networks are more resilient at some higher densities (e.g. note the lower values of α in empirical food trade networks vs. scale-free at moderate densities in figure 5(A)). For β, low density empirical food trade networks are similar to scalefree. But as density increases, scale-free networks have less hubs than do empirical food trade networks, leading food trade data to have higher β values around density values of 0.1. Although the number of hubs is higher in dense empirical food networks, they are not  as well-connected as scale-free hubs. Yet they still have the potential to be significant disease spreaders, leading empirical food trade networks to have less resilient values of β.
The empirically-observed competition parameters fall within the null-model range. Empirical α values are generally lower than null-model estimation means (see figure 4(D)). This indicates that food trade is less efficient and more resilient to targeted node removal than the null model mean would suggest. However, the empirically-observed β values are generally higher than estimation means since efficiency is lower but resilience against spread risk is roughly the same (see figure 4(E)).

Weighted network efficiency and resilience
Values of E(Γ) and R(Γ) are illustrated in figure 6 for combinations of network topologies and mass flux distributions (e.g. uniform, normal, power-law and extreme weight distribution; see figure 14 in SI). As density increases while the total network weight remains constant, the mass per link decreases. Yet, the length of the average shortest path also decreases as density increases, such that the weighted efficiency increases if the gains in shortest path lengths overpower the loss in mass per link. The weighted efficiency decreases if the loss in mass per link overpowers the gains in shortest path lengths (see figure 15 in SI). As the total network weight increases, the mass per link increases; hence, the weighted efficiency increases (see table 10 in SI). So, for a network to be more efficient it should transport more mass through the most used links. According to these numerical results, if the node weights have a uniform or normal distribution, then the lattice-like structures, i.e. ring or random network topologies, result in greater efficiency (see table 10 in SI). On the other hand, if the node weights follow a power-law or extreme distribution, then the core-periphery structures, i.e. scalefree or star network topologies, with correlated node degree and strength yield a better efficiency than do lattice-like structures (see figure 15 in SI).
The value of R(Γ) is constant with density across numerical weight distributions, since the weights assigned to each node and total network weights are constant (see figure 6(A)). In the numerical Networks that prioritize resilience over efficiency could be located by points 1 and 2. Networks that emphasize efficiency more than resilience could be located in points 5 and 6. Networks that promote both efficiency and resilience simultaneously could be indicated by points 3 and 4. Points that are closer to the origin (points 1, 3, 5) have smaller efficiency and resilience and are considered less well-designed. Points that are further from the origin (points 2, 4, 6) have higher efficiency and resilience so they are more well-designed. simulations, only the number of links connected to each node varies across network topologies as the node weight distribution and total mass are kept constant. Hence, the resilience metric does not depend on the topology but on the node weight distribution. Resilience values above the brown line in figure 6(A) have a normal weight distribution; values below the brown line have a power-law weight distribution. All empirical values are in the resilience range of the power-law weight distribution, but have a more homogeneous weight distribution as they move closer to the brown line. The empirical food network values move from more to less extreme heterogeneity with increasing density. In figure 6(B), aggregated food commodities have both the higher density and total mass. Their efficiency values are also higher. Again, empirical E(Γ) values are within the bounds of the power-law and normal weight distributions. Empirical values are close to the normal weight distribution for low densities and become more power-law as density increases. The empirical values that follow the power-law weight distribution are the aggregated food commodities.
Since resilience is constant by topology, network structures that perform better in efficiency under the same node weight distribution and same total network weight promotes weighted efficiency and resilience simultaneously. In an extreme weight distribution a star network topology promotes efficiency and resilience simultaneously; for a power-law weight distribution the scale-free network topology (where large mass exporters also have high node outdegrees), promotes both efficiency and resilience (see figure 15 and table 10 in SI). The random network topology in combination with the normal weight distribution promotes efficiency and resilience simultaneously. Ring network topology with a uniform weight distribution simultaneously promotes efficiency and resilience. In brief, if the node degree distribution correlates with the node strength distribution under the assumption of constant total weight, better efficiency and resilience is achieved (see figures 15 and 16 in SI for a summary).

Cooperation parameters for weighted networks
When trade intensity is taken into account efficiency and resilience can behave cooperatively. There are various topology and weight distribution combinations which achieve higher efficiency and resilience simultaneously. To assess the relative cooperation across networks, we introduce two cooperation parameters, ξ and ρ, to locate the networks on the graph provided in figure 7(A). The cooperation parameters, ξ and ρ, quantify the relationship between efficiency and resilience as: More detailed information regarding the transition from E(Γ) and R(Γ) to (1 − E(Γ)) and R(Γ) respectively, is provided in SI (also figures 17-19 in SI). Note that ξ ∈ [0, 2] and ξ values of 0 indicate low values of both efficiency and resilience (i.e. less welldesigned network). ξ values of 2 indicate relatively high values of both efficiency and resilience (i.e. more well-designed network). ρ captures if the network is emphasizing efficiency or resilience more, or if the two features are balanced. ρ values > 1 indicate the network is prioritizing efficiency; values < 1 indicate resilience is the priority. ρ values close to 1 indicate a balance between efficiency and resilience. The mean of (1 − E(Γ)) and R(Γ) from 2008 to 2018 for food trade are plotted in the cooperation scheme in figure 7(B). 'All agri-food' exhibits the highest levels of both efficiency and resilience (note black triangle in figure 7(B) have the highest x − y location). In  Please see table 3 for a summary of the competition and cooperation parameters.

Competition and cooperation parameters over time
The number of countries participating in trade and the number of trade connections generally increased from 1965 to 2018 (see table 4). The number of links increased more than the number of trading countries, so the density of food trade increased over time.
In general, as the density of food trade increases the topological efficiency and resilience to removal of the core node increases. However, food trade networks become more vulnerable to disease spread risk with increased density. Figures 8(A) and (B) presents α and β values through time. Values of α are more variable prior to 1990 (especially in individual food commodities), with a decreasing range after 1990 when trade becomes more dense. However, there exists a time period around 1990-1996 where the food trade networks get sparse. At the same time period, total trade amount also decreases for each food commodity (see figure 1). During this period, α values tend to increase which means that networks prioritize efficiency more than resilience. As the sparsity increases, reliance on the nation with the largest number of export connections seems to be increasing and networks get more vulnerable against targeted node attacks. However, after the food trade networks get denser, the criticality of a single nation tend to decrease whereas networks get more resilient against targeted node attack. As multiple nations become 'hubs' , α values decrease and get closer to 0.5.
Food commodity groups balance efficiency and resilience to node removal better than individual food commodities. Individual food commodities are generally prioritizing efficiency over resilience (see table 5). This is reasonable as for a single commodity, only a few countries have comparative advantages. Hence, they mainly provide the export connections. So, network efficiency is prioritized over resilience (i.e. trade is from a few key nation to every other nation but the network is highly dependent on key nations to maintain the flow transmission). However, α values are moving further away from 1 over time, indicating the networks are starting to prioritize resilience more over time. 'All agri-food' is the most resilient to reliance on a single nation. This is sensible, since there are multiple trade hub nations when all agri-food commodities are considered. The 'Grain' network is the least resilient commodity group, with the largest α values throughout the study time period (see table 5). This lack of resilience in grain trade has been exhibited in recent years, such as during the 2007-08 world food crisis and in 2010-11 when several major producers imposed export restrictions [26,74]. Figure 8(B) plots the competition between efficiency and resilience to disease spread risk (β) over time. Food trade networks are becoming more efficient over time, at the expense of resilience to spread risk (e.g. note increasing β values). This is sensible as through time number of trade relations increase, as well as the network density and connectivity. However, higher connectivity increases the potential for a contamination to spread among traded food commodities. Similar to α, the range of β decreases with time, which is consistent with the understanding that as density increases β approaches 1. The least resilient network against disease spread risk is the fish trade (mean β = 0.94); the most resilient network is the banana trade (mean β = 0.71) as fish trade has the most dense whereas banana trade has the most sparse network (see table 5). It is reasonable that the fish trade is the most vulnerable to food-borne disease spread, as disease risks associated with international trade of aquaculture have been shown to be high [75].  (see  table 4). This is because fish trade also has the largest total mass flux and more of a correlated power-law like node degree and weight distribution among its exporter nations. The least well-designed food commodity trade is soy, which has the lowest values of 1-E(Γ) and R(Γ). Soy has the lowest network density and its low total mass flux punishes its efficiency, whereas having almost an extreme weight distribution among its exporter nations punishes its resilience values. Mean ξ of fish trade is 1.45, while it is 0.72 for the soy trade (see table 5). 'All agri-food' , 'meat' and 'vegetables and fruits' commodity groups exhibit the highest ξ values over time, indicating that these networks have the highest levels of both efficiency and resilience to mass flux disruption. These groups of food commodities have high densities, and achieve relatively high 1-E(Γ) and R(Γ) values with high total network mass fluxes. More importantly, the powerlaw like node degree and strength distributions of the exporter nations highly correlate in these commodity trades. Again, 'Grain' stands out as the least welldesigned network, compared with other aggregated food commodities. The grain trade has the highest reliance on a single exporter and has the lowest efficiency in its trade connections in terms of distance per mass transported. This is mainly driven by low density and high heterogeneity in weight distribution of exporters. Table 3. Trade-off parameters to assess the relationship between efficiency and resilience. A competitive relationship is uncovered between efficiency and resilience in topological networks, so a 'competition parameter' is presented for topological networks. A cooperative relationship is uncovered between efficiency and resilience in weighted networks, so a 'cooperation parameter' is presented for weighted network.

Symbol Equation Definition
αλ d+λ Competition between topological efficiency and resilience against targeted node removal  For the ρ parameter, values closer to 1 indicate networks that are promoting efficiency and resilience simultaneously. ρ values that are larger than 1 represent networks that are prioritizing efficiency more; ρ values smaller than 1 represent networks that are prioritizing resilience more. Figure 8(D) shows ρ over time. Prior to 1990, the soy and maize trade ρ values fluctuated substantially. Yet, single food commodities have become more similar in recent decades, with values smaller than, but close to 1. This indicates that individual commodity networks have been prioritizing resilience more in recent decades (see figure 8(D)). This means that multiple nations start to participate in the mass supply in individual food commodities rather than a single major mass supplier. However, as both density and total mass flux increases through time, the efficiency (i.e. link-based shortest distance per mass trade) does not change a lot. The range of ρ parameter values is smaller for food commodity groups over time. This is because aggregated food commodities have similar weighted efficiency and resilience values. 'Grain' and 'all agrifood' have improved their resilience over efficiency with time (ρ moving from 1 to 0.8; see figure 8(D)). The trade of 'vegetables and fruit' and 'meat' also tended to improve resilience over efficiency with time (ρ moves towards 0.6 from 0.8). This could be explained by that multiple nations participate in mass supply through time. However, the link-based shortest distance per mass does not change a lot in these  commodity groups either, as total mass flux increases are complimented by density increases. In recent decades, gains in network density and total mass flux have led aggregated food commodity groups to become more similar in terms of their efficiency and resilience. Almost all food commodities tend to become more resilient through time. This trend is observable in figure 7(C) where the movement of (1 − E(Γ)) and

Comparison between unweighted and weighted networks
Here, we perform additional analysis to confirm that differences in our results between unweighted and weighted analysis are not driven by changing the efficiency and resilience metrics. Specifically, we compute the weighted network efficiency E(Γ) and resilience R(Γ) metrics on the same adjacency matrices used in the unweighted analysis. The adjacency matrices are binary, e.g. they include entries of only 0 and 1, indicating whether a trade relationship exists between two nations or not. This means that node out strength (i.e. mass export for nations) becomes node degree (i.e. number of export connections of nations). Now, the weighted efficiency metric E(Γ) collapses to the topological efficiency metric,d. The weighted resilience metric R(Γ), when applied to the adjacency matrices, determines the portion of connections remain after the elimination of the nation with highest number of export connections. E(Γ) and R(Γ) for unweighted networks are formulated in equations (10) and (11) respectively, where D i out stands for the out degree of node i.
According to the unweighted version of R(Γ), networks that have a more homogeneous distribution of export connections would be classified as more resilient. If the majority of export connections is not under the responsibility of a single nation, the food trade network would have multiple major exporters. In case of a local disruption in one of the major exporter nation, the system would still be able to maintain its structure and the majority of its connections. In this case, higher R(Γ) values would be computed, indicating higher network resilience.
As it is seen in figure 20(A) in SI, unweighted R(Γ) values for numerically-generated theoretical and empirical food trade networks increase as density increases. As networks have more connections, multiple nations get more export relations therefore, the portion of all export links on a single major exporter become relatively less important. Therefore, networks get more resilient as they become less dependent on a single major exporter to maintain the structure. However, as in figure 20(B), unweighted E(Γ) values decrease as density increases. As density increases, number of connections in the network increases. Hence, average link-based shortest path of the network gets smaller. This means that networks become more efficient, since more direct connections form between any two nation. From (A) and (B) in figure 20, we observe that core-periphery structures have lower R(Γ) and lower E(Γ) values. Hence, star and scale-free networks are less resilient but more efficient. On the contrary, lattice-like structures have higher R(Γ) and higher E(Γ) values. So ring and random networks are more resilient but less efficient.
More precisely, we have plotted R(Γ) vs E(Γ) for unweighted networks in various densities. As density kept constant, the competition between efficiency and resilience metrics becomes more clear. In figures 20(C), (E) and (G), theoretical and empirical networks with density 0.02, 0.14 and 0.26 are compared respectively. In all density values, star networks have the lowest resilience against the elimination of the major exporter nation. Then, the ascending resilience order follows as scale-free, random and ring networks since higher R(Γ) stands for higher resilience. However, the complete opposite ordering is observed when the efficiency metric E(Γ) is considered. For all densities, ring networks have the lowest connection efficiency. Then, the ascending efficiency order follows as random, scale-free and star networks since lower E(Γ) stands for higher efficiency.
Lastly, we compared unweighted R(Γ) andλ metrics to compute the consistency between these two metrics. In figures 20(D), (F) and (H), for network densities of 0.02, 0.14 and 0.26 both the numericallygenerated and empirical networks (with close density values) are plotted. Due to the formulation of R(Γ) andλ, higher R(Γ) stands for higher resilience while lowerλ means higher resilience (see section 2). Therefore, in all figures, both metrics classify lattice-like topologies as more resilient and core-periphery topologies as less resilient. More specifically, ring networks have the highest R(Γ) and lowestλ values. Then, it is followed by random, scale-free and star networks where star networks has the lowest R(Γ) and highest λ values.
Thus, we conclude that (a) the change in the nature of relationship between resilience and efficiency between unweighted and weighted analyses is not driven by differences in the metrics. By implementing the weighted resilience, R(Γ), and efficiency, E(Γ), metrics in unweighted networks, we prove that the competitive relationship still exists. Cooperation is observed when heterogeneous weight distributions are included. This means that our findings are driven by the heterogeneous intensities of food trade, rather than the definitions that we employ to quantify efficiency and resilience in our comprehensive framework. Secondly, we conclude that (b) both resilience metrics R(Γ) andλ gives a consistent understanding for all density values and for all unweighted network topologies. Both metrics assess network resilience in terms of reliance on a single nation for maintaining the network structure, but with different formulations. Both formulations enable us to confirm that lattice-like topologies are more resilient than core-periphery structures against this specific threat. Therefore, the comparison between weighted and unweighted network efficiency and resilience is consistent throughout our study.

Concluding remarks
This study presented a comprehensive network framework to evaluate the relationship between efficiency and resilience in global food trade networks. To our knowledge, this is the first integrated assessment of the trade-off between efficiency and resilience that accounts for both topological structure and trade intensities. We include resilience to both spreading risk and targeted node attack in the framework. We provide the potential range of outcomes from numerically-generated theoretical networks to better understand the empirical results. Additionally, we generate null-model statistical networks to benchmark the empirical results.
Increased connectivity of global food trade increases its efficiency at the expense of its resilience to spreading risk, corroborating the findings of Ercsey-Ravasz et al [10]. Yet, we also find that our understanding of the relationship between efficiency and resilience changes depending on the risk considered and when the intensity of trade relationships are explicitly taken into account. Networks can simultaneously promote efficiency and resilience under correlated node degree and weight distribution combinations. Indeed, we find that food trade networks, particularly those of aggregated commodities, promote both efficiency and resilience to the targeted removal of the most important mass exporter nation. This finding is distinct to previous research which suggests that increased connectivity and efficiency necessarily reduces resilience in global food trade networks [24,76].
This study highlights the importance of explicitly including weights in network analyses of global food trade. Future research could build on this study by developing an economics framework to analyze the relationship between efficiency and resilience in food trade networks. Additionally, the physical travel distances and related costs could be incorporated to enhance realism in the definition of network efficiency. Additional scenarios of production and trade shocks could be explored to determine resilience outcomes. For example, more conservative scenarios could be evaluated, where a fraction of links are removed, rather than the targeted attack and subsequent removal of the major exporter nation. Our statistical approach could be compared with scenarios to determine where they are similar and different. Importantly, a dynamic model with behavioral changes following a disturbance, such as redistribution of trade links, would improve our ability to capture the adaptive responses that may impact resilience.

Data availability statement
All data sources are listed in the methods section of the paper and are freely available online in UNCOMTRADE official website, https:// comtrade.un.org/data.