Abstract
We present algorithms for enumerating all spanning trees in directed, undirected and weighted graphs. The algorithms use a search tree technique to construct a computation tree. The computation tree is used to output all the spanning trees by listing the relative differences between spanning trees rather than the entire spanning trees themselves. For the undirected case, both the construction and the listing of the trees are shown to require O(N+V+E) time for a graph with V vertices, E edges and N spanning trees. This algorithm is optimal and is based on exchanging non-tree edges with tree edges in a fundamental cycle. A similar exchange technique is used to construct the computation tree for a directed graph in O(NV+V 3) time. The time for listing out the trees remains O(N). For a weighted graph, we show how to sort the spanning trees by weight using the computation tree in O(N log V+VE) time.
Preview
Unable to display preview. Download preview PDF.
References
J. P. Char: Generation of trees, 2 trees and storage of master forests, IEEE Trans. Circuit Theory, CT-15, 1968.
Harold N. Gabow: Two algorithms for generating weighted spanning trees in order, SIAM J. Comp., Vol 6, No. 1, March 1977.
H. N. Gabow and E. W. Myers: Finding all spanning trees of directed and undirected graphs, SIAM J. Comp., Vol 7, No. 3, Aug 1978.
W. Mayeda: Graph Theory, John Wiley, NY 1972.
G. J. Minty: A simple algorithm for listing all trees of a graph, IEEE Trans. Circuit Theory, CT-12, 1965.
R. C. Read and R. E. Tarjan: Bounds on backtrack algorithms for listing cycles, paths and spanning trees, Networks, 5, No. 3, 1975.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1991 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Kapoor, S., Ramesh, H. (1991). Algorithms for generating all spanning trees of undirected, directed and weighted graphs. In: Dehne, F., Sack, JR., Santoro, N. (eds) Algorithms and Data Structures. WADS 1991. Lecture Notes in Computer Science, vol 519. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0028284
Download citation
DOI: https://doi.org/10.1007/BFb0028284
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-54343-5
Online ISBN: 978-3-540-47566-8
eBook Packages: Springer Book Archive