[graph-tool] Problems using the dijktstra search

josubg josubg at gmail.com
Thu Jul 12 13:14:22 CEST 2012


Hi all.

I'm trying to use the dijktstra search But I have a exception.The property
that is used a int32_t and the GraphViews aren't empty. Any clue of  what is
my error?

This is the code:

        referents_graph = GraphView(graph, vfilt= lambda v:
graph.vertex_properties["type"][v]=="referent")
        navigable_graph = GraphView(graph, reversed=True)

        referents = referents_graph.vertices()
        weight = navigable_graph.edge_properties["weight"]

        for base_referent in referents:
            # Calculate the distance of all accessible referents
            distances, predecessors = 
graph_tool.search.dijkstra_search(navigable_graph,base_referent,weight)

This is the trace:

  File "/data/workspace/stanford-corenlp-python/contextgenerator.py", line
218, in resolve_corefenrence
    distances, predecessors = 
graph_tool.search.dijkstra_search(navigable_graph,base_referent,weight)
  File "/usr/local/lib/python2.7/dist-packages/graph_tool/decorators.pyc",
line 2, in dijkstra_search
    Bq�Oc
  File
"/usr/local/lib/python2.7/dist-packages/graph_tool/search/__init__.py", line
126, in wrap
    ret = func(*args, **kwargs)
  File
"/usr/local/lib/python2.7/dist-packages/graph_tool/search/__init__.py", line
841, in dijkstra_search
    compare, combine, zero, infinity)
  TypeError: No registered converter was able to produce a C++ rvalue of
type int from this Python object of type float


Thanks for the time.

--
View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/Problems-using-the-dijktstra-search-tp4024755.html
Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.



More information about the graph-tool mailing list