Simulate several types of graphs
generator_graph(p = 20, graph = "tree", dens = 0.3, r = 2, k = 3)
p | number of nodes |
---|---|
graph | type of graph, among "tree","scale-free","cluster" and "erdos" |
dens | graph density (for cluster graphs) or edges probability (for Erdös-Renyi graphs) |
r | within/between ratio connection probability (needed for cluster graphs) |
k | number of groups in cluster graphs |
the adjacency matrix, in sparse format
generator_graph(p=10,graph="tree")#> 10 x 10 sparse Matrix of class "dsCMatrix" #> #> [1,] . 1 . . . 1 . . 1 . #> [2,] 1 . . . 1 . 1 . . . #> [3,] . . . . . . . 1 1 . #> [4,] . . . . . . . 1 . 1 #> [5,] . 1 . . . . . . . . #> [6,] 1 . . . . . . . . . #> [7,] . 1 . . . . . . . . #> [8,] . . 1 1 . . . . . . #> [9,] 1 . 1 . . . . . . . #> [10,] . . . 1 . . . . . .