首先输入边和边的权重,随后画出节点位置,根据权重大小划分实边和虚边
#coding:utf-8
#!/usr/bin/env python
An example using Graph as a weighted network.
__author__ = Aric Hagberg (hagberg@lanl.gov)
try:
import matplotlib.pyplot as plt
except:
raise
import networkx as nx
G=nx.Graph()
#添加带权边
G.add_edge('a','b',weight=
1