Skip to contents

get_connected_graph

Usage

get_connected_graph(g)

Arguments

g

igraph object

Value

igraph object

Examples

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