python import networkx as nx G = nx.Graph() G.add_node("A") G.add_node("B") G.add_node("C") G.add_edge("A", "B") G.add_edge("B", "C") G.add_edge("C", "A") print(nx.info(G)) nx.draw(G, with_labels=True) plt.show() shell pip install networkx matplotlib


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