robustnessGraphAgg: Analysis of aggregated supply network robustness

Description Usage Arguments Details Value Examples

View source: R/robustness.R

Description

This function improves robustnessGraph by an aggregated approach of vertices and edges deletions, applied to spatialized risks. Vertices can be spatially concentrated in same regions (i.e. spatial entites), thus subjects to same located risks. Similarly, logistic flows can use the same roads, also subjects to located risks. Main vulnerabily points of a spatial supply network can be crossroads zones on which depend the highest betweenness edges. This function aims to explore spatial dimension of supply network robustness, both in terms of vertices and edges disruptions. The concept of aggregated graph robustness can be applied for other purposes than spatial networks: vertices can be actors belonging to same organizations facing global disruptions for example.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
robustnessGraphAgg(
  g,
  mat,
  type = c("vertices", "edges"),
  vs = V(g)[V(g)$type == "I"],
  es = E(g),
  mode = c("random", "targeted"),
  ct.ind.FUN = betweenness,
  metric.FUN = SAR,
  niter = Inf
)

Arguments

g

igraph; a supply network where every node has a 'type' attribute which can be "P" (producer), "I" (intermediary), or "D" (distributor).

mat

matrix, matrix of adjacency between vs or es to delete and entity.

type

character string; either 'vertices' or 'edges' removals. (default: 'vertices').

vs

igraph.vs; used if type='vertices', the vertices which can be deleted. (default: only intermediaries).

es

igraph.es; used if type='edges', the edges which can be deleted. (default: all graph edges).

mode

character; how to choose the vertex or the edge to delete, either 'random' or 'targeted'. If 'targeted', the v or e with highest betweenness is selected (default: 'random').

ct.ind.FUN

function; centraltity index used to targete v or e. Sum of centrality indices by entity is used.

metric.FUN

function; critical supply network metric to recompute at Each time step. (default: SAR).

niter

numeric; maximal number of removals (default: infinite).

Details

This function extends robustnessGraph with a supplementary parameter mat, corresponding to a matrix of adjacency between vertices or edges in rows, and spatial entities in columns. Relation between graph elements (V or E) and spatial entites can be represented as a bipartite graph. In further version, matrix will be replaced by an adjacency list.

Value

numeric between 0 and 1. The mean of metric.FUN over iterations.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
library(igraph)
set.seed(123)
g = make_tree(20)
V(g)[!degree(g, mode="in")]$type = "P"
V(g)[degree(g, mode="in") & degree(g, mode="in")]$type = "I"
V(g)[!degree(g, mode="out")]$type = "D"
V(g)$color = c("green","red","yellow")[factor(V(g)$type, levels=c("P","I","D"))]
plot(g)
## Build aggregation matrix
V(g)$name = as.character(seq(V(g)))
V(g)$agg_id = sample(letters[1:5], length(V(g)), replace = TRUE)
mat = xtabs(data=data.frame(v_name=V(g)$name, entity_id=V(g)$agg_id))
## Compare number of vertices by entity and the sums of their betweenness
colSums(mat)
colSums(mat * betweenness(g, rownames(mat)))
## Aggregated modes causes more damages in targeted mode
robustnessGraph(g,  type="v", mode="targ")
robustnessGraphAgg(g, mat=mat, type="v", mode="targ")

MiloMonnier/supplynet documentation built on Feb. 16, 2021, 8:03 p.m.