python import networkx as nx G = nx.Graph() G.add_node('A') G.add_node('B') G.add_edge('A', 'B') python G.add_node('C', label='Node C', weight=0.5) G.add_edge('B', 'C', weight=0.8) python import matplotlib.pyplot as plt nx.draw(G, with_labels=True) plt.show() python python


上一篇:
下一篇:
切换中文