[graph-tool-tickets] [graph-tool] Ticket #175: Similarity runtime error

graph-tool webmaster at skewed.de
Thu Jun 5 14:50:04 UTC 2014

#175: Similarity runtime error
new defect
Reporter: ayd011 at gmail.com
Owner: tiago peixoto
Priority: normal
Milestone: 2.2

Comment (by anonymous):

Replying to [ticket:175 ayd011@…]:

I tried again using a different type of property map for example int, but then it throws a different runtime error.

Traceback (most recent call last):
  File "./mcs_test.py", line 66, in <module>
    sim_deg = similarity(g1, g2,g1_int_id,g2_int_id, False)
  File "/net/heap/auras-pub/modules/python-2.7.6/lib/python2.7/site-packages/graph_tool/topology/__init__.py", line 143, in similarity
    _prop("v", g1, label1), _prop("v", g1, label2))
RuntimeError: boost::bad_any_cast: failed conversion using boost::any_cast

Ofcourse by passing explicitly the vertex_index property map, it works.

sim_deg = similarity(g1, g2,g1.vertex_index,g2.vertex_index, False)

But the vertex_index property map is of type unsigned long,which is an invalid property value type.

Previous Post:

A problem while trying to use similarity. I have loaded two graphs from two dot files and obtained a vertex PropertyMap of type string (i verified this using list_properties) for each of them

g1 = load_graph(g1_dotfile)
g2 = load_graph(g2_dotfile)
g1_instr_label = g1.vertex_properties["label"]
g2_instr_label = g2.vertex_properties["label"]


then use similarity function

sim_deg = similarity(g1, g2,g1_instr_label,g2_instr_label, False)


The traceback and debug information are:

Traceback (most recent call last):
   File "./mcs_test.py", line 56, in <module>
     sim_deg = similarity(g1, g2,g1_instr_label,g2_instr_label, False)
   File ".../modules/python-2.7.6/lib/python2.7/site-packages/graph_tool/topology/__init__.py", line 143, in similarity
     _prop("v", g1, label1), _prop("v", g1, label2))
 RuntimeError: No static implementation was found for the desired routine. This is a graph_tool bug. :-( Please follow but report instructions at http://graph-tool.skewed.de/tickets. What follows is debug information.
 Graph view: boost::adj_list<unsigned long>*
 Action: std::_Bind<graph_tool::get_similarity (std::_Placeholder<1>, std::_Placeholder<2>, std::_Placeholder<3>, boost::any, std::reference_wrapper<unsigned long>)>
 Arg 1: boost::adj_list<unsigned long>*
 Arg 2: boost::checked_vector_property_map<std::string, boost::typed_identity_property_map<unsigned long> >


 This does not happen if I use the default Property Map, the vertex index.
 In my opinion this looks to be similar to  Ticket #69: http://graph-tool.skewed.de/trac/ticket/69
 Probably because of the string nature of my property map.

Ticket URL: <URL:http://graph-tool.skewed.de/ticket/175>
graph-tool <URL:http://graph-tool.skewed.de>
An efficient python module for graph analysis and manipulation.

More information about the graph-tool-tickets mailing list