{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,2,10]],"date-time":"2026-02-10T20:29:47Z","timestamp":1770755387349,"version":"3.50.0"},"reference-count":14,"publisher":"MDPI AG","issue":"7","license":[{"start":{"date-parts":[[2024,7,13]],"date-time":"2024-07-13T00:00:00Z","timestamp":1720828800000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"DOI":"10.13039\/501100003336","name":"Bulgarian National Science Fun","doi-asserted-by":"publisher","award":["KP-06-H62\/2\/13.12.2022"],"award-info":[{"award-number":["KP-06-H62\/2\/13.12.2022"]}],"id":[{"id":"10.13039\/501100003336","id-type":"DOI","asserted-by":"publisher"}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Algorithms"],"abstract":"<jats:p>In this work, we systematize several implementations of the Gray code over an alphabet with m\u22652 elements, which we present in C code so that they can be used directly after copying from the text. We consider two variants\u2014reflected and modular (or shifted) m-ary Gray codes. For both variants, we present the ranking and unranking functions, as well as algorithms for generating only a part of the code, more precisely the codewords between two given vectors. Finally, we give algorithms that generate a maximal set of non-proportional vectors of length n over the given alphabet in a Gray code.<\/jats:p>","DOI":"10.3390\/a17070311","type":"journal-article","created":{"date-parts":[[2024,7,15]],"date-time":"2024-07-15T12:44:36Z","timestamp":1721047476000},"page":"311","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":2,"title":["Generating m-Ary Gray Codes and Related Algorithms"],"prefix":"10.3390","volume":"17","author":[{"ORCID":"https:\/\/orcid.org\/0000-0002-9557-4749","authenticated-orcid":false,"given":"Stefka","family":"Bouyuklieva","sequence":"first","affiliation":[{"name":"Faculty of Mathematics and Informatics, St. Cyril and St. Methodius University of Veliko Tarnovo, 5000 Veliko Tarnovo, Bulgaria"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-6730-1129","authenticated-orcid":false,"given":"Iliya","family":"Bouyukliev","sequence":"additional","affiliation":[{"name":"Institute of Mathematics and Informatics, Bulgarian Academy of Sciences, 5000 Veliko Tarnovo, Bulgaria"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-2503-5325","authenticated-orcid":false,"given":"Valentin","family":"Bakoev","sequence":"additional","affiliation":[{"name":"Faculty of Mathematics and Informatics, St. Cyril and St. Methodius University of Veliko Tarnovo, 5000 Veliko Tarnovo, Bulgaria"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-3489-7744","authenticated-orcid":false,"given":"Maria","family":"Pashinska-Gadzheva","sequence":"additional","affiliation":[{"name":"Institute of Mathematics and Informatics, Bulgarian Academy of Sciences, 5000 Veliko Tarnovo, Bulgaria"}]}],"member":"1968","published-online":{"date-parts":[[2024,7,13]]},"reference":[{"key":"ref_1","unstructured":"Gray, F. (1953). Pulse Code Communication. (2,632,058), U.S. Patent."},{"key":"ref_2","unstructured":"Knuth, D. (2014). The Art of Computer Programming, Volume 4A: Combinatorial Algorithms, Part 1, Addison-Wesley."},{"key":"ref_3","doi-asserted-by":"crossref","first-page":"31","DOI":"10.1016\/0020-0255(78)90020-8","article-title":"On m-ary Gray codes","volume":"15","author":"Sharma","year":"1978","journal-title":"Inf. Sci."},{"key":"ref_4","doi-asserted-by":"crossref","first-page":"739","DOI":"10.1109\/TC.1984.5009360","article-title":"On Generating the N-ary Reflected Gray Codes","volume":"c-33","author":"Er","year":"1984","journal-title":"IEEE Trans. Comput."},{"key":"ref_5","first-page":"97","article-title":"Q-ary Gray codes and weight distributions","volume":"103","author":"Gulliver","year":"1999","journal-title":"Appl. Math. Comput."},{"key":"ref_6","doi-asserted-by":"crossref","first-page":"605","DOI":"10.1137\/S0036144595295272","article-title":"A Survey of Combinatorial Gray Codes","volume":"39","author":"Savage","year":"1997","journal-title":"Siam Rev."},{"key":"ref_7","unstructured":"Ruskey, F. (2003). Combinatorial Generation. Working Version (1j-CSC 425\/520). Preliminary Working Draft, University of Victoria."},{"key":"ref_8","doi-asserted-by":"crossref","unstructured":"M\u00fctze, T. (2023). Combinatorial Gray Codes\u2014An Updated Survey. Electron. J. Comb., DS26.","DOI":"10.37236\/11023"},{"key":"ref_9","unstructured":"Kapralov, S. (2004). Bounds, Constructions and Classification of Optimal Codes. [Ph.D. Dissertation, Technical University]. (In Bulgarian)."},{"key":"ref_10","first-page":"841","article-title":"Generalized Gray Codes with Applications","volume":"22","author":"Guan","year":"1998","journal-title":"Proc. Natl. Sci. Counc. ROC(A)"},{"key":"ref_11","doi-asserted-by":"crossref","first-page":"517","DOI":"10.1145\/360336.360343","article-title":"Efficient generation of the binary reflected gray code and its applications","volume":"19","author":"Bitner","year":"1976","journal-title":"Commun. ACM"},{"key":"ref_12","doi-asserted-by":"crossref","unstructured":"Kreher, D., and Stinson, D. (1999). Combinatorial Algorithms: Generation, Enumeration and Search, CRC Press.","DOI":"10.1145\/309739.309744"},{"key":"ref_13","unstructured":"Lipski, W. (1982). Kombinatoryka dla Programist\u00f3w (Combinatorics for Programmers), Wydawnictwa Naukowo-Techniczne. (In Polish, Russian translation\u2014Mir, Moskva, 1988)."},{"key":"ref_14","doi-asserted-by":"crossref","first-page":"485","DOI":"10.1109\/TIT.2002.807305","article-title":"The separability of standard cyclic N-ary Gray codes","volume":"49","author":"Suparta","year":"2003","journal-title":"IEEE Trans. Inf. Theory"}],"container-title":["Algorithms"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/1999-4893\/17\/7\/311\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,10]],"date-time":"2025-10-10T15:16:20Z","timestamp":1760109380000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/1999-4893\/17\/7\/311"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2024,7,13]]},"references-count":14,"journal-issue":{"issue":"7","published-online":{"date-parts":[[2024,7]]}},"alternative-id":["a17070311"],"URL":"https:\/\/doi.org\/10.3390\/a17070311","relation":{},"ISSN":["1999-4893"],"issn-type":[{"value":"1999-4893","type":"electronic"}],"subject":[],"published":{"date-parts":[[2024,7,13]]}}}