Abstract.
According to Cayley's tree formula, there are n n-2 labelled trees on n vertices. Prüfer gave a bijection between the set of labelled trees on n vertices and sequences of n-2 numbers, each in the range 1, 2, ..., n . Such a number sequence is called a Prüfer code. The straightforward implementation of his bijection takes O(n log n ) time. In this paper we propose an O(n) time algorithm for the same problem. Our algorithm can be easily parallelized so that a Prüfer code can be generated in O (log n ) time using O(n) processors on the EREW PRAM computational model.
Similar content being viewed by others
Author information
Authors and Affiliations
Additional information
Received October 2, 1998, and in final form March 1, 1999.
Rights and permissions
About this article
Cite this article
-C. Chen, H., -L. Wang, Y. An Efficient Algorithm for Generating Prüfer Codes from Labelled Trees. Theory Comput. Systems 33, 97–105 (2000). https://doi.org/10.1007/s002249910006
Issue Date:
DOI: https://doi.org/10.1007/s002249910006