finding all minimal spanning trees [duplicate]
Asked Answered
L

3

7

Possible Duplicate:
All minimum spanning trees implementation

How can I find all minimum spanning trees in an undirected graph in an efficient way?

Ligament answered 31/12, 2010 at 9:31 Comment(2)
Note the number of minimum spanning trees can be exponential in the graph size, so you probably don't want to return them all.Venatic
@keith Knuth wrote a whole book about enumerating trees in graphs. Just because you have an exponential number of something doesn't mean you don't want to see them all. In this case it just means it's not practical so see all of them for a general large graph.Griskin
B
1

Apologies for the academic answer... but algorithm S in Knuth's TAOCP, Volume 4, Fascicle 4 is exactly about generating all spanning trees (pp. 26ff). There are a few musings when he talks about generating (spanning) trees, but your best bet in TAOCP.

Bluenose answered 31/12, 2010 at 20:57 Comment(0)
G
0

Yes, there are algorithms for generating all spanning trees in a graph. At least one compresses the output by generating only diffs between the trees. As others have pointed out, there might be a lot of minimum spanning trees for even a small graph.

Griskin answered 25/9, 2011 at 19:46 Comment(0)
M
-1

you can find one..modifying the BFS algorithm!

Mccurdy answered 25/9, 2011 at 19:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.