Closed GoogleCodeExporter closed 9 years ago
Thank you for your report.
I suppose you created the second graph from the spanning tree returned by
graph.minimal_spanning_tree(), right? Well, the spanning tree does not contains
any
weight information (it's just a pairing between nodes, nothing else). so this
is the
intended behavior.
About the generated spanning tree not being minimal, you are right. We are using
Prim's algorithm to calculate the minimal spanning trees, but it should only be
used
against graphs, not digraphs. I'm removing it from the digraph class.
Original comment by pmatiello
on 2 Apr 2009 at 12:12
I think there should be an easy way to get the MST of a graph as a copy of the
original graph with all the edges not belonging to the MST removed. I think
this is
needed quite commonly, and this was what I meant with my report.
Yes, I was using digraph, this was the cause of the issue. I am sorry, but I
have
just started handling graphs again after many years ;). Anyway I know that a few
algorithms to get the MST of a digraph exist. Is there any chance that they get
implemented?
Original comment by sukkopera
on 2 Apr 2009 at 8:50
About the copying thing, I'll consider if and how it should be added to the
library.
About MST for digraphs, well, it's my intention. But it's likely to take some
time as
I'm a too busy by now.
Original comment by pmatiello
on 2 Apr 2009 at 11:55
Original issue reported on code.google.com by
sukkopera
on 1 Apr 2009 at 10:26