0
I have this network graph in R:
library(igraph)
set.seed(123)
n <- 20
g <- sample_gnm(n, m = n * 2, directed = FALSE)
while (!is_connected(g)) {
# Find disconnected components
components <- components(g)
for (i in 2:components$no) {
from <- sample(which(components$mem...