library(igraph)
# Example electrical network graph
elec <- matrix(ncol = 2, byrow = TRUE, c(
11,1, 11,10, 1,2, 2,3, 2,9,
3,4, 3,8, 4,5, 5,6, 5,7,
6,7, 7,8, 8,9, 9,10
))
gra <- graph_from_edgelist(elec, directed = FALSE)
# Compute vulnerability measures
f4 <- swan_combinatory(gra, 10)
Run the code above in your browser using DataLab