Previous Article in Journal
Messy Broadcasting in Grid
Previous Article in Special Issue
A General Statistical Physics Framework for Assignment Problems
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
This is an early access version, the complete PDF, HTML, and XML versions will be available soon.
Article

Generating m-Ary Gray Codes and Related Algorithms

by
Stefka Bouyuklieva
1,*,
Iliya Bouyukliev
2,
Valentin Bakoev
1 and
Maria Pashinska-Gadzheva
2
1
Faculty of Mathematics and Informatics, St. Cyril and St. Methodius University of Veliko Tarnovo, 5000 Veliko Tarnovo, Bulgaria
2
Institute of Mathematics and Informatics, Bulgarian Academy of Sciences, 5000 Veliko Tarnovo, Bulgaria
*
Author to whom correspondence should be addressed.
Algorithms 2024, 17(7), 311; https://doi.org/10.3390/a17070311 (registering DOI)
Submission received: 28 June 2024 / Revised: 9 July 2024 / Accepted: 10 July 2024 / Published: 13 July 2024

Abstract

In this work, we systematize several implementations of the Gray code over an alphabet with m2 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.
Keywords: Gray code; m-ary Gray code; combinatorial algorithms; combinatorial generation; ranking; unranking Gray code; m-ary Gray code; combinatorial algorithms; combinatorial generation; ranking; unranking

Share and Cite

MDPI and ACS Style

Bouyuklieva, S.; Bouyukliev, I.; Bakoev, V.; Pashinska-Gadzheva, M. Generating m-Ary Gray Codes and Related Algorithms. Algorithms 2024, 17, 311. https://doi.org/10.3390/a17070311

AMA Style

Bouyuklieva S, Bouyukliev I, Bakoev V, Pashinska-Gadzheva M. Generating m-Ary Gray Codes and Related Algorithms. Algorithms. 2024; 17(7):311. https://doi.org/10.3390/a17070311

Chicago/Turabian Style

Bouyuklieva, Stefka, Iliya Bouyukliev, Valentin Bakoev, and Maria Pashinska-Gadzheva. 2024. "Generating m-Ary Gray Codes and Related Algorithms" Algorithms 17, no. 7: 311. https://doi.org/10.3390/a17070311

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Article metric data becomes available approximately 24 hours after publication online.
Back to TopTop