A Unified Approach to Coding Labeled Trees

  • Saverio Caminiti
  • Irene Finocchi
  • Rossella Petreschi
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2976)


We consider the problem of coding labeled trees by means of strings of node labels and we present a unified approach based on a reduction of both coding and decoding to integer (radix) sorting. Applying this approach to four well-known codes introduced by Prüfer [18], Neville [17], and Deo and Micikevicius [5], we close some open problems. With respect to coding, our general sequential algorithm requires optimal linear time, thus solving the problem of optimally computing the second code presented by Neville. The algorithm can be parallelized on the EREW PRAM model, so as to work in O(log n) time using O(n) or \(O(n \sqrt{log n})\) operations, depending on the code.

With respect to decoding, the problem of finding an optimal sequential algorithm for the second Neville code was also open, and our general scheme solves it. Furthermore, in a parallel setting our scheme yields the first efficient decoding algorithms for the codes in [5] and [17].


Parallel Algorithm Decode Algorithm Parallel Setting Node Label Span Tree Problem 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Atallah, M.J., Cole, R., Goodrich, M.T.: Cascading divide-and-conquer: a technique for designing parallel algorithms. SIAM Journal of Computing 18(3), 499–532 (1989)zbMATHCrossRefMathSciNetGoogle Scholar
  2. 2.
    Cayley, A.: A theorem on trees. Quarterly Journal of Mathematics 23, 376–378 (1889)Google Scholar
  3. 3.
    Chen, H.C., Wang, Y.L.: An efficient algorithm for generating Prüfer codes from labelled trees. Theory of Computing Systems 33, 97–105 (2000)zbMATHCrossRefMathSciNetGoogle Scholar
  4. 4.
    Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to algorithms. McGraw-Hill, New York (2001)zbMATHGoogle Scholar
  5. 5.
    Deo, N., Micikevicius, P.: A new encoding for labeled trees employing a stack and a queue. Bulletin of the Institute of Combinatorics and its Applications 34, 77–85 (2002)zbMATHMathSciNetGoogle Scholar
  6. 6.
    Deo, N., Micikevicius, P.: Prüfer-like codes for labeled trees. Congressus Numerantium 151, 65–73 (2001)zbMATHMathSciNetGoogle Scholar
  7. 7.
    Deo, N., Micikevicius, P.: Parallel algorithms for computing Prüfer-like codes of labeled trees. Computer Science Technical Report CS-TR-01-06 (2001)Google Scholar
  8. 8.
    Edelson, W., Gargano, M.L.: Feasible encodings for GA solutions of constrained minimal spanning tree problems. In: Proceedings of the Genetic and Evolutionary Computation Conference, p. 754. Morgan Kaufmann Publishers, San Francisco (2000)Google Scholar
  9. 9.
    Greenlaw, R., Halldorsson, M.M., Petreschi, R.: On computing Prüfer codes and their corresponding trees optimally. In: Proceedings Journees de l’Informatique Messine, Graph algorithms (2000)Google Scholar
  10. 10.
    Greenlaw, R., Petreschi, R.: Computing Prüfer codes efficiently in parallel. Discrete Applied Mathematics 102, 205–222 (2000)zbMATHCrossRefMathSciNetGoogle Scholar
  11. 11.
    Han, Y., Shen, X.: Parallel integer sorting is more efficient than parallel comparison sorting on exclusive write PRAMS. SIAM Journal of Computing 31(6), 1852–1878 (1852)CrossRefMathSciNetGoogle Scholar
  12. 12.
    Jájá, J.: An Introduction to parallel algorithms. Addison Wesley, Reading (1992)zbMATHGoogle Scholar
  13. 13.
    Kelmans, A., Pak, I., Postnikov, A.: Tree and forest volumes of graphs. DIMACS Technical Report 2000-03 (2000)Google Scholar
  14. 14.
    Kumar, V., Deo, N., Kumar, N.: Parallel generation of random trees and connected graphs. Congressus Numerantium 130, 7–18 (1998)zbMATHMathSciNetGoogle Scholar
  15. 15.
    Lo, W.T., Peng, S.: The optimal location of a structured facility in a tree network. Journal of Parallel Algorithms and Applications 2, 43–60 (1994)zbMATHGoogle Scholar
  16. 16.
    Moon, J.W.: Counting labeled trees. William Clowes and Sons, London (1970)Google Scholar
  17. 17.
    Neville, E.H.: The codifying of tree structures. Proceedings of Cambridge Philosophical Society 49, 381–385 (1953)zbMATHCrossRefMathSciNetGoogle Scholar
  18. 18.
    Prüfer, H.: Neuer Beweis eines Satzes über Permutationen. Archiv für Mathematik und Physik 27, 142–144 (1918)Google Scholar
  19. 19.
    Wang, Y.L., Chen, H.C., Liu, W.K.: A parallel algorithm for constructing a labeled tree. IEEE Transactions on Parallel and Distributed Systems 8(12), 1236–1240 (1997)CrossRefGoogle Scholar
  20. 20.
    Zhou, G., Gen, M.: A note on genetic algorithms for degree-constrained spanning tree problems. Networks 30, 91–95 (1997)zbMATHCrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2004

Authors and Affiliations

  • Saverio Caminiti
    • 1
  • Irene Finocchi
    • 2
  • Rossella Petreschi
    • 1
  1. 1.DSIUniversità degli Studi di Roma “La Sapienza”RomaItaly
  2. 2.DISPUniversità degli Studi di Roma “Tor Vergata”RomaItaly

Personalised recommendations