我试图在使用PythonNetworkX的N次迭代之后找到命中率(权威和中心)
示例-
import networkx as nx
G1 = nx.DiGraph()
G1.add_edges_from([('A', 'B'),
('A','C'),
('D','C'),
('D', 'C'),
('C', 'A'),
('B','C')
])
#nx.draw_networkx(G1,arrows=True,pos=nx.spring_layout(G1))
对于int迭代,我得到以下错误。如何修复它
nx.hits(G1, max_iter=5)
NetworkXError: HITS: power iteration failed to converge in 5 iterations.
max_iter
参数仅控制幂次迭代的最大迭代次数。您希望中止迭代并获得当前结果。为此,您可以轻松地修改^{相关问题 更多 >
编程相关推荐