A loopless algorithm for generating (k, m)-ary trees in Gray code order

A family of ( k ,  m )-ary trees was firstly introduced by Du and Liu when they studied hook length polynomial for plane trees. Recently, Amani and Nowzari-Dalini presented a generation algorithm to produce ( k ,  m )-ary trees of order n encoding by Z-sequences in reverse lexicographic order. In th...

Celý popis

Uloženo v:
Podrobná bibliografie
Vydáno v:Optimization letters Ročník 15; číslo 4; s. 1133 - 1154
Hlavní autoři: Chang, Yu-Hsuan, Wu, Ro-Yu, Lin, Cheng-Kuan, Chang, Jou-Ming
Médium: Journal Article
Jazyk:angličtina
Vydáno: Berlin/Heidelberg Springer Berlin Heidelberg 01.06.2021
Témata:
ISSN:1862-4472, 1862-4480
On-line přístup:Získat plný text
Tagy: Přidat tag
Žádné tagy, Buďte první, kdo vytvoří štítek k tomuto záznamu!
Popis
Shrnutí:A family of ( k ,  m )-ary trees was firstly introduced by Du and Liu when they studied hook length polynomial for plane trees. Recently, Amani and Nowzari-Dalini presented a generation algorithm to produce ( k ,  m )-ary trees of order n encoding by Z-sequences in reverse lexicographic order. In this paper, we propose a loopless algorithm to generate all such Z-sequences in Gray code order. Hence, the worst-case time complexity of generating one Z-sequence is O ( 1 ) , and the space requirement of our algorithm is 2 n + O ( 1 ) . Moreover, based on this ordering, we also provide ranking and unranking algorithms. The ranking algorithm can be run in O ( max { k m n , n 2 } ) time and O ( k m n ) space, whereas the unranking algorithm requires O ( k m n 2 ) time and space.
ISSN:1862-4472
1862-4480
DOI:10.1007/s11590-020-01613-z