{"id":{"repo_id":"uvic","oai_identifier":"oai:dspace.library.uvic.ca:1828/1966"},"canonical_url":"https://search.ndltd.org/etd/uvic/oai:dspace.library.uvic.ca:1828/1966","repository":{"repo_id":"uvic","name":"University of Victoria (Canada)","base_url":"https://dspace.library.uvic.ca/server/oai/request"},"display":{"title":"Shift gray codes","abstract":"Combinatorial objects can be represented by strings, such as 21534 for the permutation (1 2) (3 5 4), or 110100 for the binary tree corresponding to the balanced parentheses (()()). Given a string s = s1 s2 sn, the right-shift operation shift(s, i, j) replaces the substring si si+1..sj by si+1..sj si. In other words, si is right-shifted into position j by applying the permutation (j j−1 .. i) to the indices of s. Right-shifts include prefix-shifts (i = 1) and adjacent-transpositions (j = i+1). A fixed-content language is a set of strings that contain the same multiset of symbols. Given a fixed-content language, a shift Gray code is a list of its strings where consecutive strings differ by a shift. This thesis asks if shift Gray codes exist for a variety of combinatorial objects. This abstract question leads to a number of practical answers. The first prefix-shift Gray code for multiset permutations is discovered, and it provides the first algorithm for generating multiset permutations in O(1)-time while using O(1) additional variables. Applications of these results include more efficient exhaustive solutions to stacker-crane problems, which are natural NP-complete traveling salesman variants. This thesis also produces the fastest algorithm for generating balanced parentheses in an array, and the first minimal-change order for fixed-content necklaces and Lyndon words. These results are consequences of the following theorem: Every bubble language has a right-shift Gray code. Bubble languages are fixed-content languages that are closed under certain adjacent-transpositions. These languages generalize classic combinatorial objects: k-ary trees, ordered trees with fixed branching sequences, unit interval graphs, restricted Schr oder and Motzkin paths, linear-extensions of B-posets, and their unions, intersections, and quotients. Each Gray code is circular and is obtained from a new variation of lexicographic order known as cool-lex order. Gray codes using only shift(s, 1, n) and shift(s, 1, n−1) are also found for multiset permutations. A universal cycle that omits the last (redundant) symbol from each permutation is obtained by recording the first symbol of each permutation in this Gray code. As a special case, these shorthand universal cycles provide a new fixed-density analogue to de Bruijn cycles, and the first universal cycle for the \"middle levels\" (binary strings of length 2k + 1 with sum k or k + 1).","abstract_html":"Combinatorial objects can be represented by strings, such as 21534 for the permutation (1 2) (3 5 4), or 110100 for the binary tree corresponding to the balanced parentheses (()()). Given a string s = s1 s2 sn, the right-shift operation shift(s, i, j) replaces the substring si si+1..sj by si+1..sj si. In other words, si is right-shifted into position j by applying the permutation (j j−1 .. i) to the indices of s. Right-shifts include prefix-shifts (i = 1) and adjacent-transpositions (j = i+1). A fixed-content language is a set of strings that contain the same multiset of symbols. Given a fixed-content language, a shift Gray code is a list of its strings where consecutive strings differ by a shift. This thesis asks if shift Gray codes exist for a variety of combinatorial objects. This abstract question leads to a number of practical answers. The first prefix-shift Gray code for multiset permutations is discovered, and it provides the first algorithm for generating multiset permutations in O(1)-time while using O(1) additional variables. Applications of these results include more efficient exhaustive solutions to stacker-crane problems, which are natural NP-complete traveling salesman variants. This thesis also produces the fastest algorithm for generating balanced parentheses in an array, and the first minimal-change order for fixed-content necklaces and Lyndon words. These results are consequences of the following theorem: Every bubble language has a right-shift Gray code. Bubble languages are fixed-content languages that are closed under certain adjacent-transpositions. These languages generalize classic combinatorial objects: k-ary trees, ordered trees with fixed branching sequences, unit interval graphs, restricted Schr oder and Motzkin paths, linear-extensions of B-posets, and their unions, intersections, and quotients. Each Gray code is circular and is obtained from a new variation of lexicographic order known as cool-lex order. Gray codes using only shift(s, 1, n) and shift(s, 1, n−1) are also found for multiset permutations. A universal cycle that omits the last (redundant) symbol from each permutation is obtained by recording the first symbol of each permutation in this Gray code. As a special case, these shorthand universal cycles provide a new fixed-density analogue to de Bruijn cycles, and the first universal cycle for the &quot;middle levels&quot; (binary strings of length 2k + 1 with sum k or k + 1).","abstract_has_math":false,"creators":["Williams, Aaron Michael"],"institution":null,"degree_name":null,"degree_level":"Doctor of Philosophy Ph.D.","degree_discipline":null,"degree_department":"Department of Computer Science","school":null,"contributors":[],"advisors":["Ruskey, Frank","Myrvold, W. J."],"committee_chairs":[],"committee_members":[],"year":2009,"date_issued":"2009-12-11T23:39:39Z","date_published":"2009-12-11T23:39:39Z","updated_at":"2026-11-19T09:47:50Z","subjects":["shorthand universal cycles","combinatorial generation","minimal-change order","loopless algorithm","efficient algorithm","combinations","multiset permutations","balanced parentheses","Dyck words","Catalan paths","Schroder paths","Motzkin words","linear-extensions","posets","connected unit interval graphs","inversions","binary trees","k-ary trees","ordered trees with fixed branching sequence","Lyndon words","pre-necklaces","theoretical computer science","discrete mathematics","combinatorics","brute forcs","de Bruijn cycles","bubble languages","cool-lex order","lexicographic order","combinatorial enumeration","stacker-crane problem","traveling salesman problem","middle levels","fixed-density de Bruijn cycle","fixed-content","UVic Subject Index::Sciences and Engineering::Applied Sciences::Computer science","UVic Subject Index::Sciences and Engineering::Mathematics"],"languages":["en","English"],"rights":["Available to the World Wide Web"],"rights_urls":[],"identifier_entries":[{"key":"dc:identifier.citation","label":"Dc Identifier Citation","values":["A. Williams. Loopless generation of multiset permutations using a constant number of variables by pre x shifts. In SODA '09: The Twentieth Annual ACM-SIAM Symposium on Discrete Algorithms, New York, New York, USA, 2009.","F. Ruskey and A. Williams. The coolest way to generate combinations. Discrete Mathematics, 309(17):5305{5320, September 2009.","F. Ruskey and A. Williams. Generating balanced parentheses and binary trees by pre x shifts. In CATS '08: Fourteenth Computing: The Australasian Theory Symposium, volume 77 of CRPIT, Wollongong, Australia, 2008. ACS.","F. Ruskey and A. Williams. An explicit universal cycle for the (n − 1)- permutations of an n-set. ACM Transactions on Algorithms, (accepted), 2008.","F. Ruskey and A. Williams. Generating combinations by pre x shifts. In COCOON '05: Computing and Combinatorics, 11th Annual International Conference, volume 3595 of Lecture Notes in Computer Science, pages 570{576, Kunming, China, 2005. Springer-Verlag."],"render_values":[{"text":"A. Williams. Loopless generation of multiset permutations using a constant number of variables by pre x shifts. In SODA '09: The Twentieth Annual ACM-SIAM Symposium on Discrete Algorithms, New York, New York, USA, 2009.","href":null,"code":true},{"text":"F. Ruskey and A. Williams. The coolest way to generate combinations. Discrete Mathematics, 309(17):5305{5320, September 2009.","href":null,"code":true},{"text":"F. Ruskey and A. Williams. Generating balanced parentheses and binary trees by pre x shifts. In CATS '08: Fourteenth Computing: The Australasian Theory Symposium, volume 77 of CRPIT, Wollongong, Australia, 2008. ACS.","href":null,"code":true},{"text":"F. Ruskey and A. Williams. An explicit universal cycle for the (n − 1)- permutations of an n-set. ACM Transactions on Algorithms, (accepted), 2008.","href":null,"code":true},{"text":"F. Ruskey and A. Williams. Generating combinations by pre x shifts. In COCOON '05: Computing and Combinatorics, 11th Annual International Conference, volume 3595 of Lecture Notes in Computer Science, pages 570{576, Kunming, China, 2005. Springer-Verlag.","href":null,"code":true}]}],"person_identifier_entries":[]},"links":{"outbound_url":"http://hdl.handle.net/1828/1966","outbound_label":"Handle","outbound_source":"dc:identifier.uri","record_url":"http://hdl.handle.net/1828/1966","record_label":"Repository record","record_kind":"handle","record_source":"dc:identifier.uri","download_url":null,"download_label":null,"download_source":null,"access_status":null,"embargo_until":null,"access_note":null},"source_record":{"url":"https://dspace.library.uvic.ca/server/oai/request?verb=GetRecord&metadataPrefix=dim&identifier=oai%3Adspace.library.uvic.ca%3A1828%2F1966","prefix":"dim"},"metadata_groups":[{"id":"people","label":"People","entries":[{"key":"dc:contributor.supervisor","label":"Supervisor","values":["Ruskey, Frank","Myrvold, W. J."]},{"key":"dc:creator","label":"Author","values":["Williams, Aaron Michael"]}]},{"id":"academic_context","label":"Academic Context","entries":[{"key":"dc:date.accessioned","label":"Dc Date Accessioned","values":["2009-12-11T23:39:39Z"]},{"key":"dc:date.available","label":"Dc Date Available","values":["2009-12-11T23:39:39Z"]},{"key":"dc:date.copyright","label":"Dc Date Copyright","values":["2009"]},{"key":"dc:date.issued","label":"Date","values":["2009-12-11T23:39:39Z"]},{"key":"dc:type","label":"Dc Type","values":["Thesis"]},{"key":"thesis:degree_department","label":"Department","values":["Department of Computer Science"]},{"key":"thesis:degree_level","label":"Degree Level","values":["Doctor of Philosophy Ph.D."]}]},{"id":"subjects_keywords","label":"Subjects and Keywords","entries":[{"key":"dc:subject","label":"Dc Subject","values":["shorthand universal cycles","combinatorial generation","minimal-change order","loopless algorithm","efficient algorithm","combinations","multiset permutations","balanced parentheses","Dyck words","Catalan paths","Schroder paths","Motzkin words","linear-extensions","posets","connected unit interval graphs","inversions","binary trees","k-ary trees","ordered trees with fixed branching sequence","Lyndon words","pre-necklaces","theoretical computer science","discrete mathematics","combinatorics","brute forcs","de Bruijn cycles","bubble languages","cool-lex order","lexicographic order","combinatorial enumeration","stacker-crane problem","traveling salesman problem","middle levels","fixed-density de Bruijn cycle","fixed-content"]},{"key":"dc:subject.lcsh","label":"Dc Subject Lcsh","values":["UVic Subject Index::Sciences and Engineering::Applied Sciences::Computer science","UVic Subject Index::Sciences and Engineering::Mathematics"]}]},{"id":"language_rights","label":"Language and Rights","entries":[{"key":"dc:language","label":"Dc Language","values":["English"]},{"key":"dc:language.iso","label":"Language (ISO)","values":["en"]},{"key":"dc:rights","label":"Dc Rights","values":["Available to the World Wide Web"]}]},{"id":"identifiers","label":"Identifiers","entries":[{"key":"dc:identifier.citation","label":"Dc Identifier Citation","values":["A. Williams. Loopless generation of multiset permutations using a constant number of variables by pre x shifts. In SODA '09: The Twentieth Annual ACM-SIAM Symposium on Discrete Algorithms, New York, New York, USA, 2009.","F. Ruskey and A. Williams. The coolest way to generate combinations. Discrete Mathematics, 309(17):5305{5320, September 2009.","F. Ruskey and A. Williams. Generating balanced parentheses and binary trees by pre x shifts. In CATS '08: Fourteenth Computing: The Australasian Theory Symposium, volume 77 of CRPIT, Wollongong, Australia, 2008. ACS.","F. Ruskey and A. Williams. An explicit universal cycle for the (n − 1)- permutations of an n-set. ACM Transactions on Algorithms, (accepted), 2008.","F. Ruskey and A. Williams. Generating combinations by pre x shifts. In COCOON '05: Computing and Combinatorics, 11th Annual International Conference, volume 3595 of Lecture Notes in Computer Science, pages 570{576, Kunming, China, 2005. Springer-Verlag."]},{"key":"dc:identifier.uri","label":"Identifier URI","values":["http://hdl.handle.net/1828/1966"]}]},{"id":"additional","label":"Additional Metadata","entries":[{"key":"dc:description.abstract","label":"Abstract","values":["Combinatorial objects can be represented by strings, such as 21534 for the permutation (1 2) (3 5 4), or 110100 for the binary tree corresponding to the balanced parentheses (()()). Given a string s = s1 s2 sn, the right-shift operation shift(s, i, j) replaces the substring si si+1..sj by si+1..sj si. In other words, si is right-shifted into position j by applying the permutation (j j−1 .. i) to the indices of s. Right-shifts include prefix-shifts (i = 1) and adjacent-transpositions (j = i+1). A fixed-content language is a set of strings that contain the same multiset of symbols. Given a fixed-content language, a shift Gray code is a list of its strings where consecutive strings differ by a shift. This thesis asks if shift Gray codes exist for a variety of combinatorial objects. This abstract question leads to a number of practical answers. The first prefix-shift Gray code for multiset permutations is discovered, and it provides the first algorithm for generating multiset permutations in O(1)-time while using O(1) additional variables. Applications of these results include more efficient exhaustive solutions to stacker-crane problems, which are natural NP-complete traveling salesman variants. This thesis also produces the fastest algorithm for generating balanced parentheses in an array, and the first minimal-change order for fixed-content necklaces and Lyndon words. These results are consequences of the following theorem: Every bubble language has a right-shift Gray code. Bubble languages are fixed-content languages that are closed under certain adjacent-transpositions. These languages generalize classic combinatorial objects: k-ary trees, ordered trees with fixed branching sequences, unit interval graphs, restricted Schr oder and Motzkin paths, linear-extensions of B-posets, and their unions, intersections, and quotients. Each Gray code is circular and is obtained from a new variation of lexicographic order known as cool-lex order. Gray codes using only shift(s, 1, n) and shift(s, 1, n−1) are also found for multiset permutations. A universal cycle that omits the last (redundant) symbol from each permutation is obtained by recording the first symbol of each permutation in this Gray code. As a special case, these shorthand universal cycles provide a new fixed-density analogue to de Bruijn cycles, and the first universal cycle for the \"middle levels\" (binary strings of length 2k + 1 with sum k or k + 1)."]},{"key":"dc:title","label":"Title","values":["Shift gray codes"]}]}],"canonical_facts":{"dc:contributor.supervisor":["Ruskey, Frank","Myrvold, W. J."],"dc:creator":["Williams, Aaron Michael"],"dc:date.accessioned":["2009-12-11T23:39:39Z"],"dc:date.available":["2009-12-11T23:39:39Z"],"dc:date.copyright":["2009"],"dc:date.issued":["2009-12-11T23:39:39Z"],"dc:description.abstract":["Combinatorial objects can be represented by strings, such as 21534 for the permutation (1 2) (3 5 4), or 110100 for the binary tree corresponding to the balanced parentheses (()()). Given a string s = s1 s2 sn, the right-shift operation shift(s, i, j) replaces the substring si si+1..sj by si+1..sj si. In other words, si is right-shifted into position j by applying the permutation (j j−1 .. i) to the indices of s. Right-shifts include prefix-shifts (i = 1) and adjacent-transpositions (j = i+1). A fixed-content language is a set of strings that contain the same multiset of symbols. Given a fixed-content language, a shift Gray code is a list of its strings where consecutive strings differ by a shift. This thesis asks if shift Gray codes exist for a variety of combinatorial objects. This abstract question leads to a number of practical answers. The first prefix-shift Gray code for multiset permutations is discovered, and it provides the first algorithm for generating multiset permutations in O(1)-time while using O(1) additional variables. Applications of these results include more efficient exhaustive solutions to stacker-crane problems, which are natural NP-complete traveling salesman variants. This thesis also produces the fastest algorithm for generating balanced parentheses in an array, and the first minimal-change order for fixed-content necklaces and Lyndon words. These results are consequences of the following theorem: Every bubble language has a right-shift Gray code. Bubble languages are fixed-content languages that are closed under certain adjacent-transpositions. These languages generalize classic combinatorial objects: k-ary trees, ordered trees with fixed branching sequences, unit interval graphs, restricted Schr oder and Motzkin paths, linear-extensions of B-posets, and their unions, intersections, and quotients. Each Gray code is circular and is obtained from a new variation of lexicographic order known as cool-lex order. Gray codes using only shift(s, 1, n) and shift(s, 1, n−1) are also found for multiset permutations. A universal cycle that omits the last (redundant) symbol from each permutation is obtained by recording the first symbol of each permutation in this Gray code. As a special case, these shorthand universal cycles provide a new fixed-density analogue to de Bruijn cycles, and the first universal cycle for the \"middle levels\" (binary strings of length 2k + 1 with sum k or k + 1)."],"dc:identifier.citation":["A. Williams. Loopless generation of multiset permutations using a constant number of variables by pre x shifts. In SODA '09: The Twentieth Annual ACM-SIAM Symposium on Discrete Algorithms, New York, New York, USA, 2009.","F. Ruskey and A. Williams. The coolest way to generate combinations. Discrete Mathematics, 309(17):5305{5320, September 2009.","F. Ruskey and A. Williams. Generating balanced parentheses and binary trees by pre x shifts. In CATS '08: Fourteenth Computing: The Australasian Theory Symposium, volume 77 of CRPIT, Wollongong, Australia, 2008. ACS.","F. Ruskey and A. Williams. An explicit universal cycle for the (n − 1)- permutations of an n-set. ACM Transactions on Algorithms, (accepted), 2008.","F. Ruskey and A. Williams. Generating combinations by pre x shifts. In COCOON '05: Computing and Combinatorics, 11th Annual International Conference, volume 3595 of Lecture Notes in Computer Science, pages 570{576, Kunming, China, 2005. Springer-Verlag."],"dc:identifier.uri":["http://hdl.handle.net/1828/1966"],"dc:language":["English"],"dc:language.iso":["en"],"dc:rights":["Available to the World Wide Web"],"dc:subject":["shorthand universal cycles","combinatorial generation","minimal-change order","loopless algorithm","efficient algorithm","combinations","multiset permutations","balanced parentheses","Dyck words","Catalan paths","Schroder paths","Motzkin words","linear-extensions","posets","connected unit interval graphs","inversions","binary trees","k-ary trees","ordered trees with fixed branching sequence","Lyndon words","pre-necklaces","theoretical computer science","discrete mathematics","combinatorics","brute forcs","de Bruijn cycles","bubble languages","cool-lex order","lexicographic order","combinatorial enumeration","stacker-crane problem","traveling salesman problem","middle levels","fixed-density de Bruijn cycle","fixed-content"],"dc:subject.lcsh":["UVic Subject Index::Sciences and Engineering::Applied Sciences::Computer science","UVic Subject Index::Sciences and Engineering::Mathematics"],"dc:title":["Shift gray codes"],"dc:type":["Thesis"],"thesis:degree_department":["Department of Computer Science"],"thesis:degree_level":["Doctor of Philosophy Ph.D."]},"updated_at":"2026-11-19T09:47:50Z"}