Skip to main content

Generating Spanning-Tree Sequences of a Fan Graph in Lexicographic Order and Ranking/Unranking Algorithms

  • Conference paper
  • First Online:
  • 344 Accesses

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

Abstract

Cameron et al. [27th Int. Conf. Computing and Combinatorics (COCOON 2021), LNCS 13025, pp. 49–60] recently presented an algorithm for generating all spanning trees of a fan graph in \(\mathcal {O}(1)\)-amortized time. The listing of spanning trees fulfills the so-called pivot Gray code property so that successive trees differ by pivoting a single edge around a vertex. They also presented algorithms for ranking and unranking a spanning tree in the listing in \(\mathcal {O}(n)\) time using \(\mathcal {O}(n)\) space. In this paper, we first observe that all spanning trees of a fan graph can be naturally represented by integer sequences so that their coding tree has properties with regularity. Then, we propose a simple algorithm for generating spanning-tree sequences in lexicographic order in \(\mathcal {O}(1)\)-amortized time according to these properties. Additionally, based on the lexicographic order, we develop ranking and unranking algorithms in \(\mathcal {O}(n)\)-time using \(n+\mathcal {O}(1)\) space (i.e., the size of the space is just slightly larger than n).

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   64.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   84.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

References

  1. Bogdanowicz, Z.R.: Formulas for the number of spanning trees in a fan. Appl. Math. Sci. 2(16), 781–786 (2008)

    MathSciNet  MATH  Google Scholar 

  2. Cameron, B., Grubb, A., Sawada, J.: A pivot gray code listing for the spanning trees of the fan graph. In: Chen, C.-Y., Hon, W.-K., Hung, L.-J., Lee, C.-W. (eds.) COCOON 2021. LNCS, vol. 13025, pp. 49–60. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-89543-3_5

    Chapter  Google Scholar 

  3. Chakraborty, M., Chowdhury, S., Chakraborty, J., Mehera, R., Pal, R.K.: Algorithms for generating all possible spanning trees of a simple undirected connected graph: an extensive review. Complex Intell. Syst. 5(3), 265–281 (2019). https://doi.org/10.1007/s40747-018-0079-7

    Article  Google Scholar 

  4. Chang, Y.-H., Wu, R.-Y., Lin, C.-K., Chang, J.-M.: A loopless algorithm for generating \((k, m)\)-ary trees in gray code order. Optim. Lett. 15(4), 1133–1154 (2021). https://doi.org/10.1007/s11590-020-01613-z

    Article  MathSciNet  MATH  Google Scholar 

  5. Colbourn, C.J., Day, R.P., Nel, L.D.: Unranking and ranking spanning trees of a graph. J. Algorithms 10(2), 271–286 (1989)

    Article  MathSciNet  MATH  Google Scholar 

  6. Colbourn, C.J., Myrvold, W.J., Neufeld, E.: Two algorithms for unranking arborescences. J. Algorithms 20(2), 268–281 (1996)

    Article  MathSciNet  MATH  Google Scholar 

  7. Datta, S., Chakraborty, S., Chakraborty, M., Pal, R.K.: Algorithm to generate all spanning tree structures of a complete graph. In: Balas, V.E., Hassanien, A.E., Chakrabarti, S., Mandal, L. (eds.) Proceedings of International Conference on Computational Intelligence, Data Science and Cloud Computing. LNDECT, vol. 62, pp. 169–184. Springer, Singapore (2021). https://doi.org/10.1007/978-981-33-4968-1_14

    Chapter  Google Scholar 

  8. Eǧecioǧlu, Ö., Remmel, J.B., Williamson, S.G.: A class of graphs which has efficient ranking and unranking algorithms for spanning trees and forests. Int. J. Found. Comput. Sci. 15(4), 619–648 (2004)

    Article  MathSciNet  MATH  Google Scholar 

  9. Gabow, H.N., Myers, E.W.: Finding all spanning trees of directed and undirected graphs. SIAM J. Comput. 7(3), 280–287 (1978)

    Article  MathSciNet  MATH  Google Scholar 

  10. Golynski, A.: Optimal lower bounds for rank and select indexes. Theor. Comput. Sci. 387(3), 348–359 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  11. Kapoor, S., Ramesh, H.: Algorithms for enumerating all spanning trees of undirected and weighted graphs. SIAM J. Comput. 24(2), 247–265 (1995)

    Article  MathSciNet  MATH  Google Scholar 

  12. Kapoor, S., Ramesh, H.: An algorithm for enumerating all spanning trees of a directed graph. Algorithmica 27(2), 120–130 (2000). https://doi.org/10.1007/s004530010008

    Article  MathSciNet  MATH  Google Scholar 

  13. Mäkinen, V., Navarro, G.: Rank and select revisited and extended. Theor. Comput. Sci. 387(3), 332–347 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  14. Matsui, T.: A flexible algorithm for generating all the spanning trees in undirected graphs. Algorithmica 18(4), 530–543 (1997). https://doi.org/10.1007/PL00009171

    Article  MathSciNet  MATH  Google Scholar 

  15. Minty, G.J.: A simple algorithm for listing all the trees of a graph. IEEE Trans. Circuit Theory 12(1), 120 (1965)

    Article  Google Scholar 

  16. Reddy, K.K.M., Renjith, P., Sadagopan, N.: Listing all spanning trees in Halin graphs - sequential and parallel view. Discrete Math. Algorithms Appl. 10(1), 1850005 (2018)

    Article  MathSciNet  MATH  Google Scholar 

  17. Remmel, J.B., Williamson, S.G.: Spanning trees and function classes. Electron. J. Comb. 9(1), R34 (2002)

    Article  MathSciNet  MATH  Google Scholar 

  18. Remmel, J.B., Williamson, S.G.: Ranking and unranking trees with a given number or a given set of leaves. arXiv:1009.2060v1

  19. Shioura, A., Tamura, A., Uno, T.: An optimal algorithm for scanning all spanning trees of undirected graphs. SIAM J. Comput. 26(3), 678–692 (1997)

    Article  MathSciNet  MATH  Google Scholar 

  20. Wu, R.-Y., Chang, J.-M., Chang, C.-H.: Ranking and unranking of non-regular trees with a prescribed branching sequence. Math. Comput. Model. 53(5–6), 1331–1335 (2011)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Acknowledgments

This research was supported by the Ministry of Science and Technology of Taiwan under Grants MOST110-2221-E-262–002 (R.-Y. Wu) and MOST110-2221-E-141–004 (J.-M. Chang).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jou-Ming Chang .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Wu, RY., Tseng, CC., Hung, LJ., Chang, JM. (2022). Generating Spanning-Tree Sequences of a Fan Graph in Lexicographic Order and Ranking/Unranking Algorithms. In: Ljubić, I., Barahona, F., Dey, S.S., Mahjoub, A.R. (eds) Combinatorial Optimization. ISCO 2022. Lecture Notes in Computer Science, vol 13526. Springer, Cham. https://doi.org/10.1007/978-3-031-18530-4_15

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-18530-4_15

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-18529-8

  • Online ISBN: 978-3-031-18530-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics