On coding labeled trees

https://doi.org/10.1016/j.tcs.2007.03.009Get rights and content
Under an Elsevier user license
open archive

Abstract

We consider the problem of coding labeled trees by means of strings of node labels. Different codes have been introduced in the literature by Prüfer, Neville, and Deo and Micikevičius. For all of them, we show that both coding and decoding can be reduced to integer (radix) sorting, closing several open problems within a unified framework that can be applied both in a sequential and in a parallel setting. Our sequential coding and decoding schemes require optimal O(n) time when applied to n-node trees, yielding the first linear time decoding algorithm for a code presented by Neville. These schemes can be parallelized on the EREW PRAM model, so as to work in O(logn) time with cost O(n), O(nlogn), or O(nlogn), depending on the code and on the operation: in all cases, they either match or improve the performances of the best ad hoc approaches known so far.

Keywords

Graph algorithms
Labeled trees
Prüfer-like codes
Data structures

Cited by (0)

Work supported in part by the Italian Ministry of University and Scientific Research (project “ALINWEB: Algorithmics for Internet and the Web”) and by the University of Rome “La Sapienza” (project “Parallel and Distributed Codes”). A preliminary version of this work appeared in the Proceedings of the 6th Latin American Symposium on Theoretical Informatics (LATIN’04) [S. Caminiti, I. Finocchi, R. Petreschi, A unified approach to coding labeled trees, in: Proceedings of the 6th Latin American Symposium on Theoretical Informatics, in: LNCS, vol. 2976, 2004, pp. 339–348].