networks构造星型网络
import networkx as nx import matplotlib.pyplot as plt n = 200 SN = nx.star_graph(n) #构建星型网络; fig, ax = plt.subplots() nx.draw(SN, node_size = 500, with_labels=True) fig.show()
networks构造星型网络
import networkx as nx import matplotlib.pyplot as plt n = 200 SN = nx.star_graph(n) #构建星型网络; fig, ax = plt.subplots() nx.draw(SN, node_size = 500, with_labels=True) fig.show()