首页 > 解决方案 > Add edges to scale-free network

问题描述

This is my code:

network2 <- igraph::sample_pa(1000, m = 3, directed=F)
ecount(network2)

My goal is a network with 1000 vertices (done) and 3000 edges (I only get to 2994). Is there a way to add edges according to the Barabasi/Albert model and not just random edges?

标签: rrandomigraph

解决方案


这是 1000 个节点和 3000 个边的代码。

set.seed(1234)
g = sample_degseq(out.deg = rep(6,1000), method = "simple.no.multiple")
g

推荐阅读