lengthenShortEdge: Turn a short supply chain into a long supply chain

Description Usage Arguments Value Examples

View source: R/rewiring.R

Description

Choose a random short supply-chain edge going directly from producers to distributors, delete it, and replace it by a path of two edges length passing through an intermediary chosen randomly.

Usage

1

Arguments

g

an igraph object.

Value

an igraph object.

Examples

1
2
3
4
5
6
## Turn all short SC into long SC
library(igraph)
g = generateSupplyNet(E=200)
while (length(E(g)[E(g)$type=="PD"]))
  g = lengthenShortEdge(g)
ecount(g)

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