我正在尝试计算具有多条边的图中的命中数我在networkx中编写了一个小代码,如下所示:
import networkx as nx
import matplotlib.pylab as plot
g=nx.read_pajek("D:\Slash.net")
h,a=nx.hits(g)
但是当我尝试执行代码时,出现以下错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\networkx-1.7-py2.7.egg\networkx
\link_analysis\hits_alg.py", line 74, in hits
raise Exception("hits() not defined for graphs with multiedges.")
Exception: hits() not defined for graphs with multiedges.
请看看它谢谢和问候!