4

Is there any easy way to enumerate all spanning trees of a indirected graph? This can have O(2^n) complexity. The number of nodes on the graph is always lower than 10. I know Knuth has an algorithm on Volume 4 of TAoCP but I cant find it.

1 Answers1

4

There are other works in the literature, did you check them? First an algorithm by Char, which is described in [Jayakumar et al.'84]. There's also the algorithm of [Kapoor & Ramesh'91], which is described in details in their article, and the work of [Postnikov'94]

Also, you might have a look at this other tread: Find all spanning trees of a directed weighted graph (some answers mention undirected graphs).

Finally, note that even if the algorithmic complexity is very high, this might not be a problem in practice, on such a small graph.

Community
  • 1
  • 1
Vincent Labatut
  • 1,788
  • 1
  • 25
  • 38