Generation of permutations of multisets
Date
1986
Authors
Ko, Chun Wa
Journal Title
Journal ISSN
Volume Title
Publisher
Abstract
A multiset is a set in which elements may repeat. A permutation of a multiset is a permutation of the sequence consisting of all elements in the multiset. An algorithm is given that generates all permutations of a multiset such that consecutively generated permutations differ by an interchange of elements. On average the permutat10ns are generated in time bounded by a constant, independent of the number of symbols and n, the length of each permutation. Ranking and unranking algorithms of order O(n²) for the generat10n algorithm are also given.
An adjacent interchange generation algorithm for multiset permutations has the following property consecutively generated permutations differ by an interchange of adjacent elements. However it is not always possible to generate all permutations of a multiset by adjacent interchange. The problem of determining if an adjacent interchange algorithm exists for a multiset is equivalent to determining if a Hamilton path exists in the graph whose vertices are the multiset permutations and whose edges represent adjacent interchange. Necessary conditions are given for such graphs not to contain any Hamilton path.
A rooted ordered tree with n₀+1 leaves and nᵢ internal nodes with i children each, for i = 1, ,t, can be represented uniquely by a sequence cons1stmg of nᵢ occurrences of i, i = 0, ,t Such sequences are permutations of multisets. The results for multiset generation by adjacent interchange are extended to rooted trees represented by these sequences. Necessary conditions on nᵢ, i = 0, ,t, are given for cases where it is impossible to generate by adjacent interchange all trees with the prescribed number of leaves and internal nodes.
Description
Keywords
UN SDG 17: Partnerships