generateSpanningTrees(A)
Version 1.0.0.0 (7.67 KB) by
Matthias Hotz
Find all spanning trees of a connected undirected graph.
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 (2026). 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 LinuxCategories
Find more on Undirected Graphs in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
