igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Question on MST computation


From: Tamas Nepusz
Subject: Re: [igraph] Question on MST computation
Date: Thu, 22 May 2008 21:39:26 +0200

Dear Rossano,

I get strange results from the computation of the MST on a weighted undirected graph. Does the graph have to be simple? The graph I need to extract the MST from contains multiple edges.
Unfortunately it looks like the current implementation assumes that the graph is simple:

>> g = Graph([(0,1), (0,1), (1,2)])
>> g.es["weight"] = [1,2,3]
>> g2 = g.spanning_tree()
>> g2.get_edgelist()
[(0, 1), (1, 2)]
>> g2.es["weight"]
[2, 3]

Thanks for reporting that, it will be corrected in igraph 0.5.1. Note that if you have more edges between vertices v1 and v2, you can safely remove all but one (the one possessing the smallest weight) and re-run the calculation on the simplified graph.

--
Tamas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]