|Subject:||Re: [igraph] Maximum Common Subgraph|
|Date:||Fri, 11 Mar 2011 15:56:56 +0100|
|User-agent:||Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:18.104.22.168) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8|
Yes, beacuse the two versions (0.5 and 0.6) are binary incompatible; i.e. there were a few updates in the C layer that require the recompilation of the Python interface as well.
You don't need GraphBase; Graph derives from GraphBase and the latter is an internal thing anyway :)
Also, there is one other modification that you have to do; get_subisomorphisms_vf2 does not start using the vertex names "magically", it requires a numeric vector where each element specifies the "color" (or "label") of the corresponding vertex. You have to construct that mapping from names to numeric IDs yourself, and then pass the vectors mapping vertices to "colors" to get_subisomorphisms_vf2. I'll try to adapt your example:
g = Graph.Formula("A-B-D")
g2 = Graph.Formula("B-D")
all_names = set(g.vs["name"]).union(g2.vs["name"])
names_to_colors = dict((v, k) for k, v in enumerate(all_names))
colors1 = [names_to_colors[name] for name in g.vs["name"]]
colors2 = [names_to_colors[name] for name in g2.vs["name"]]
print g.get_subisomorphisms_vf2(g2, colors1, colors2)
This one prints "[[1, 2]]" for me; I think this is the correct result as vertex 0 of the second graph maps to vertex 1 of the first one and vertex 1 of the second graph maps to vertex 2 of the first one, and there is no other mapping, right?
I'll prepare a Snow Leopard installer for you in the evening or tomorrow, when time allows.
|[Prev in Thread]||Current Thread||[Next in Thread]|