| robustness_auc | R Documentation |
Computes the area under the robustness curve using trapezoidal integration. Higher AUC indicates a more robust network. Maximum AUC is 1.0.
robustness_auc(x)
x |
A robustness result from |
Numeric AUC value between 0 and 1.
if (requireNamespace("igraph", quietly = TRUE)) {
g <- igraph::sample_pa(30, m = 2, directed = FALSE)
rob_btw <- robustness(g, measure = "betweenness")
rob_rnd <- robustness(g, measure = "random", n_iter = 20)
cat("Betweenness attack AUC:", round(robustness_auc(rob_btw), 3), "\n")
cat("Random failure AUC:", round(robustness_auc(rob_rnd), 3), "\n")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.