Skip to contents

Generates a union of star graphs given the weights

Usage

generate_star_union(wts, n)

Arguments

wts

The proportion of the hub degrees

n

The number of nodes in the new graph

Value

A disjoint union of star graphs

Examples

library(igraph)
wts <- c(0.5, 0.3, 0.2)
gr <- generate_star_union(wts, n = 100)
gr
#> IGRAPH 910bc12 U--- 100 97 -- Star
#> + attr: name_1 (g/c), name_2 (g/c), mode_1 (g/c), mode_2 (g/c),
#> | center_1 (g/n), center_2 (g/n), name (g/c), mode (g/c), center (g/n)
#> + edges from 910bc12:
#>  [1]  1-- 2  1-- 3  1-- 4  1-- 5  1-- 6  1-- 7  1-- 8  1-- 9  1--10  1--11
#> [11]  1--12  1--13  1--14  1--15  1--16  1--17  1--18  1--19  1--20  1--21
#> [21]  1--22  1--23  1--24  1--25  1--26  1--27  1--28  1--29  1--30  1--31
#> [31]  1--32  1--33  1--34  1--35  1--36  1--37  1--38  1--39  1--40  1--41
#> [41]  1--42  1--43  1--44  1--45  1--46  1--47  1--48  1--49  1--50 51--52
#> [51] 51--53 51--54 51--55 51--56 51--57 51--58 51--59 51--60 51--61 51--62
#> [61] 51--63 51--64 51--65 51--66 51--67 51--68 51--69 51--70 51--71 51--72
#> + ... omitted several edges