igraph / python-igraph

Python interface for igraph
GNU General Public License v2.0
1.31k stars 249 forks source link

minimum spanning tree #195

Closed istvanftoth closed 6 years ago

istvanftoth commented 6 years ago

Is there any function in igraph which returns minimum spanning tree for DIRECTED and weighted networks ? If there is not, can you suggest any solution ? Many thanks

Make sure that these boxes are checked before submitting your issue -- thank you!

ntamas commented 6 years ago

We support undirected graphs in igraph only; for directed graphs, edge directions will be ignored. I guess that for the general directed case, you are looking for an algorithm that would produce an in-arborescence or an out-arborescence (i.e. a subset of edges such that the root node is reachable from every other node via them, or that all other nodes can be reached from the root node via them). If this is the case, you need to implement Edmonds' algorithm, or use this implementation after figuring out how to convert your igraph graph into the format required by this implementation.