Skip to main content

Algorithms for generating all spanning trees of undirected, directed and weighted graphs

  • Conference paper
  • First Online:
Algorithms and Data Structures (WADS 1991)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 519))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. J. P. Char: Generation of trees, 2 trees and storage of master forests, IEEE Trans. Circuit Theory, CT-15, 1968.

    Google Scholar 

  2. Harold N. Gabow: Two algorithms for generating weighted spanning trees in order, SIAM J. Comp., Vol 6, No. 1, March 1977.

    Google Scholar 

  3. 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.

    Google Scholar 

  4. W. Mayeda: Graph Theory, John Wiley, NY 1972.

    Google Scholar 

  5. G. J. Minty: A simple algorithm for listing all trees of a graph, IEEE Trans. Circuit Theory, CT-12, 1965.

    Google Scholar 

  6. R. C. Read and R. E. Tarjan: Bounds on backtrack algorithms for listing cycles, paths and spanning trees, Networks, 5, No. 3, 1975.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Frank Dehne Jörg-Rüdiger Sack Nicola Santoro

Rights and permissions

Reprints 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

Publish with us

Policies and ethics