Stefka Bouyuklieva, Iliya Bouyukliev, Valentin Bakoev, Maria Pashinska-Gadzheva
{"title":"Generating m-Ary Gray Codes and Related Algorithms","authors":"Stefka Bouyuklieva, Iliya Bouyukliev, Valentin Bakoev, Maria Pashinska-Gadzheva","doi":"10.3390/a17070311","DOIUrl":null,"url":null,"abstract":"In this work, we systematize several implementations of the Gray code over an alphabet with m≥2 elements, which we present in C code so that they can be used directly after copying from the text. We consider two variants—reflected 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.","PeriodicalId":1,"journal":{"name":"Accounts of Chemical Research","volume":"66 43","pages":""},"PeriodicalIF":17.7000,"publicationDate":"2024-07-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Accounts of Chemical Research","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.3390/a17070311","RegionNum":1,"RegionCategory":"化学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"CHEMISTRY, MULTIDISCIPLINARY","Score":null,"Total":0}
引用次数: 0
Abstract
In this work, we systematize several implementations of the Gray code over an alphabet with m≥2 elements, which we present in C code so that they can be used directly after copying from the text. We consider two variants—reflected 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.
在这项工作中,我们对字母表上 m≥2 个元素的格雷码的几种实现方法进行了系统化,并用 C 代码将其呈现出来,以便从文本中复制后直接使用。我们考虑了两种变体--反射式和模块式(或移位式)m-ary 格雷码。对于这两种变体,我们都给出了排序和取消排序的函数,以及只生成部分代码的算法,更确切地说,是两个给定向量之间的码字。最后,我们给出了在给定字母表上生成最大长度为 n 的非比例向量集的格雷码算法。
期刊介绍:
Accounts of Chemical Research presents short, concise and critical articles offering easy-to-read overviews of basic research and applications in all areas of chemistry and biochemistry. These short reviews focus on research from the author’s own laboratory and are designed to teach the reader about a research project. In addition, Accounts of Chemical Research publishes commentaries that give an informed opinion on a current research problem. Special Issues online are devoted to a single topic of unusual activity and significance.
Accounts of Chemical Research replaces the traditional article abstract with an article "Conspectus." These entries synopsize the research affording the reader a closer look at the content and significance of an article. Through this provision of a more detailed description of the article contents, the Conspectus enhances the article's discoverability by search engines and the exposure for the research.