generateSpanningTre​es(A)

Find all spanning trees of a connected undirected graph.
600 Downloads
Updated 2 Nov 2015

View License

The function “generateSpanningTrees(A)” generates all spanning trees for the connected undirected simple graph that is described by the adjacency matrix A. It is an implementation of 'Algorithm S' on p. 464 of the book “The Art of Computer Programming”, Volume 4A (Combinatorial Algorithms, Part 1), by Donald E. Knuth. Furthermore, a function “getNumberSpanningTrees(A)” is included, which computes the total number of spanning trees using Kirchhoff's matrix tree theorem.

Cite As

Matthias Hotz (2024). generateSpanningTrees(A) (https://www.mathworks.com/matlabcentral/fileexchange/53787-generatespanningtrees-a), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Undirected Graphs in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0