SAR: Supply Availability Rate

Description Usage Arguments Value Examples

View source: R/robustness.R

Description

Supply Avalability Rate (SAR) compare the number of distributors still supplied in a network o the number of distributors in a reference network. Intended to measure the impacts of successive diisruptions on a supply network. Used in robustness assessment process.

Usage

1
SAR(g0, g)

Arguments

g0

igraph; the initial supply network.

g

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

Value

A Supply Availability Rate (SAR) between 0 and 1.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Generate a theoretical supply network, define producers (P), intermediaries (I)
## and distributors (D) vertices.
library(igraph)
g = make_tree(10)
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)
## Delete intermediary with highest betweenness and apply cascding disruptions
g2 = delete_vertices(g, V(g)[which.max(betweenness(g))])
g2 = applyCascadingFailures(g2)
plot(g2)
SAR(g, g2)

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