I have a directed graph G in networkx and I want to get the minimum spanning tree of it. I do:
T = nx.algorithms.minimum_spanning_tree( G.to_undirected() ) This is undirected and I would like to restore the directions but I don't know how to do it. I tried:
G[T.edges()] This last line looks very pythonic but this is not the way networkx works, apparently... Does anyone knows how to do it?
In other words: How can I get the subgraph of a directed tree given the (undirected) edges ?