2 Star 2 Fork 2

Secure_DisOpt&Cont/Top-k influence node acquisition in a complex network model

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
BANetwork.py 504 Bytes
一键复制 编辑 原始数据 按行查看 历史
五星好瓶 提交于 2023-05-09 07:15 . add BANetwork.py.
import networkx as nx
import matplotlib.pyplot as plt
BA= nx.random_graphs.barabasi_albert_graph(30,3) #生成n=30、m=2的BA无标度网络
pos = nx.spring_layout(BA) #定义一个布局,此处采用了spring布局方式
plt.figure(figsize=(10,10))
d=dict(BA.degree)
nx.draw(BA,pos,with_labels=True,node_size = [v*150 for v in d.values()]) #绘制图形
foo_fig = plt.gcf() # 'get current figure'
foo_fig.savefig('BA_30nodes.eps', format='eps', dpi=1000)
plt.show()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/Secure_DisOpt/top-k-influence-node-acquisition-in-a-complex-network-model.git
git@gitee.com:Secure_DisOpt/top-k-influence-node-acquisition-in-a-complex-network-model.git
Secure_DisOpt
top-k-influence-node-acquisition-in-a-complex-network-model
Top-k influence node acquisition in a complex network model
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385