get_connected_graph
Examples
g <- igraph::sample_gnp(10, 0.5)
get_connected_graph(g)
#> IGRAPH 8a794c8 U--- 10 25 -- Erdos-Renyi (gnp) graph
#> + attr: name (g/c), type (g/c), loops (g/l), p (g/n)
#> + edges from 8a794c8:
#> [1] 1-- 3 2-- 3 2-- 4 1-- 5 4-- 5 1-- 6 2-- 6 3-- 6 5-- 6 1-- 7 4-- 7 5-- 7
#> [13] 1-- 8 2-- 8 5-- 8 6-- 8 2-- 9 4-- 9 6-- 9 3--10 4--10 6--10 7--10 8--10
#> [25] 9--10