| robustness | R Documentation |
Performs a targeted attack or random failure analysis on a network and computes the size of the largest (weakly) connected component after each vertex or edge removal.
In a targeted attack, vertices are ranked by degree or betweenness centrality (edges by edge betweenness) and removed from highest to lowest. In a random failure analysis, vertices or edges are removed in random order.
robustness(
x,
type = c("vertex", "edge"),
measure = c("betweenness", "degree", "random"),
strategy = c("sequential", "static"),
n_iter = 1000,
mode = "all",
seed = NULL,
...
)
x |
Network input: matrix, igraph, network, cograph_network, or tna object |
type |
Character string; either "vertex" or "edge" removals. Default: "vertex" |
measure |
Character string; rank by "betweenness", "degree", or remove in "random" order. Default: "betweenness". "degree" is not available for edge removals and raises an error. |
strategy |
Character string. "sequential" (default) recomputes the centrality after each removal. "static" computes the centrality once on the original network and removes elements in that fixed order, as in brainGraph. The argument applies to targeted attacks only. |
n_iter |
Integer; number of random removal sequences averaged when
|
mode |
Degree mode for directed networks: "all", "in", or "out".
Default "all". Used only when |
seed |
Random seed for reproducibility. Default NULL. |
... |
Passed to |
A betweenness attack removes the vertices or edges that lie on the most
shortest paths, which bridge different regions of the network. A degree
attack removes the most connected vertices first. Random failure removes
vertices or edges in random order and averages the component sizes over
n_iter sequences. Betweenness is computed with igraph, which treats
edge weights as distances.
The sequential strategy updates the ranking after every removal, so the attack follows the vertices that become new bridges or hubs. The static strategy ranks once on the original network, as in Albert et al. (2000).
Scale-free networks are typically robust to random failures and vulnerable to targeted attacks. Random networks degrade more uniformly.
A data frame (class "cograph_robustness") with one row per removal
step, from zero removed through all removed (n + 1 rows, where
n is the number of vertices or edges), and columns:
Fraction of vertices/edges removed (0 to 1)
Size of largest component after removal (averaged over
n_iter runs when measure = "random")
Ratio of component size to original maximum
The measure argument: "betweenness", "degree", or
"random"
A label for the analysis, one of "Targeted vertex attack", "Targeted edge attack", "Random vertex removal" or "Random edge removal"
The last row always has comp_size = 0. The original number of
vertices or edges ("n_original") and the original largest-component
size ("orig_max") are stored as attributes.
Albert, R., Jeong, H., & Barabasi, A.L. (2000). Error and attack tolerance of complex networks. Nature, 406, 378-381. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1038/35019019")}
plot_robustness, robustness_auc
robustness(regulation_net, measure = "betweenness")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.