r - 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?
解决方案
这是 1000 个节点和 3000 个边的代码。
set.seed(1234)
g = sample_degseq(out.deg = rep(6,1000), method = "simple.no.multiple")
g
推荐阅读
- paraview - 在后台使用 ParaView API 构建桌面应用程序
- wpf - 如何获取绑定到 ListView 作为 ItemSource 的列表?
- java - 自定义硬件按钮事件/意图
- python - 在 Pandas Dataframe 上分组并使用 APPLY 和 MAX 操作
- python - 如何在python,pandas中获取特定的数据点
- html - 我的文本框中的文本与左侧中心对齐。我该如何删除这个?
- gatsby - Gatsbyjs,如何使 build cmd 使用缓存的先前生成的静态文件?
- amazon-web-services - 使用 AWS CloudFormation 设置 S3 存储桶级事件
- php - 卷曲 Instagram api。我的头像不显示
- r - 绘图未显示在 flexdashboard 选项卡中