当前位置: X-MOL 学术Optim. Lett. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
A loopless algorithm for generating ( k , m )-ary trees in Gray code order
Optimization Letters ( IF 1.3 ) Pub Date : 2020-06-27 , DOI: 10.1007/s11590-020-01613-z
Yu-Hsuan Chang , Ro-Yu Wu , Cheng-Kuan Lin , Jou-Ming Chang

A family of (km)-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 (km)-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 \({\mathcal {O}}(1)\), and the space requirement of our algorithm is \(2n+{\mathcal {O}}(1)\). Moreover, based on this ordering, we also provide ranking and unranking algorithms. The ranking algorithm can be run in \({\mathcal {O}}(\max \{kmn,n^2\})\) time and \({\mathcal {O}}(kmn)\) space, whereas the unranking algorithm requires \({\mathcal {O}}(kmn^2)\) time and space.



中文翻译:

格雷码顺序生成(k,m)元树的无循环算法。

Du和Liu在研究平面树的钩长多项式时首先引入了(k,  m)元树族。最近,Amani和Nowzari-Dalini提出了一种生成算法,以按字典顺序的Z序列生成n阶的(k,  m)进制树。在本文中,我们提出了一种无环算法,以格雷码顺序生成所有此类Z序列。因此,生成一个Z序列的最坏情况下的时间复杂度为\({\ mathcal {O}}(1)\),而我们算法的空间要求为\(2n + {\ mathcal {O}}(1 )\)。此外,基于此排序,我们还提供了排名和排名算法。排序算法可以在\({\ mathcal {O}}(\ max \ {kmn,n ^ 2 \}))\)时间和\({\ mathcal {O}}(kmn)\)空间中运行,而解等级算法需要\({\ mathcal {O}}(kmn ^ 2)\)的时间和空间。

更新日期:2020-06-27
down
wechat
bug