RuntimeError exception thrown from eigenvector() if weight is not set
graph-tool version: 2.2.15; python version: 2.7
When graph_tool.centrality.eigenvector is called without the '''weight''' attribute, the algorithm crashes with the following message
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/graph_tool/centrality/__init__.py", line 460, in eigenvector
_prop("v", g, vprop), epsilon, max_iter)
RuntimeError
If we explicitly set all weights to 1.0
, it calculates just fine.
prop = g_gt.new_edge_property("double")
for e in g_gt.edges():
prop[e] = 1.0
eigenvector = gt.eigenvector(g_gt, epsilon=1e-7, max_iter=100000, weight=prop)
Sorry, can't narrow that down any further, I'm just getting to know the inner structure of graph-tool right now.
Oh, and there's a typo in the doc - file ./graph_tool/centrality/__init__.py
, line 367; should be ''weight'' - is ''weights''