如何获得邻接矩阵形成小世界模型?
如何创建邻接矩阵,如何建立该代码的连接?(我的意思是,如果更改邻接矩阵,连接应更改)
import networkx as nx
import matplotlib.pyplot as plt
G = nx.watts_strogatz_graph(n = 10, m = 4, p = 0.5)
pos = nx.circular_layout()
plt.figure(figsize = (12, 12))
nx.draw_networkx(G, pos)
How do I create adjacency matrix and how can I make the connections as I want form this code?(I mean if I change the adjacency matrix, connection should change )
import networkx as nx
import matplotlib.pyplot as plt
G = nx.watts_strogatz_graph(n = 10, m = 4, p = 0.5)
pos = nx.circular_layout()
plt.figure(figsize = (12, 12))
nx.draw_networkx(G, pos)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论