Abstract
Problems of search and enumeration of binary and ternary equidistant codes are considered in the paper. We investigate some combinatorial algorithms and develop specialized computer packages to find non-equivalent optimal binary and ternary equidistant codes for 3 ≤ d ≤ n ≤ 9.
1. Introduction
We can define a q-ary code as a set of M vectors with length n over the alphabet and with additional conditions that any two different vectors (codewords) differ in at least d coordinates. If we add a restriction for all the codewords to have Hamming weight w, then it becomes a constant weight. The notation is . Research on such codes is presented in [,,,,,,,]. If indicates the biggest value M for an code, then a code with parameters is considered optimal. More results about such codes can be found in [,,,]. An equidistant code is a set of M codewords of length n over the alphabet , and any two different codewords differ in exactly d positions. We can define an equidistant constant weight code as a set of M codewords of length n over the alphabet , any two different codewords differ in exactly d positions and all its codewords have the same weight w.
Let be the maximum number of codewords in an equidistant code with length n and distance d between codewords. Let be the maximum number of codewords in an equidistant constant weight code with length n, distance d between codewords and weight w of each codeword. An equidistant code with codewords is called optimal. An equidistant constant weight with codewords is called optimal. Equidistant codes have been investigated in [,,,,].
In this paper, classification of optimal binary and ternary equidistant codes for There are two important problems in coding theory related to code generation and code enumeration up to equivalence. These are NP-complete tasks and that is why they are not trivial [,].
2. Preliminaries
The following theorems consider some known restrictions and bounds that will be used for code searching and enumeration. Let denote the maximum number of codewords of a code over the alphabet with q elements, distance d and length n.
Theorem 1.
- .
- (Johnson bound) .
- .
Theorem 2.
- []
Theorem 3.
- [] .
- (Plotkin) [,] if the denominator is positive.
- (Delsarte) [] .
These theorems are extensively used in computer algorithms used for code generation and code enumeration. Bounds for the size of codes restrict searching space and reduce the calculation time.
Moreover, in Section 4 will be discussed how code generation and code enumeration can be performed concurrently to optimize the performance of the whole process.
3. Code Searching
In [,,,], some combinatorial methods for obtaining the bounds on the size of the codes are presented. Here we will present methods for a computer search of binary and ternary equidistant codes that we will use in the enumeration process.
We say that the lexicographic order of two columns of a code and is preserved if , and , for some k, .
3.1. Backtrack Search
- Add the all-zero codeword to the code.
- Fix the second codeword of the searched code with .
- The set of codewords that will be used for searching contains all the codewords that are at a distance exactly equal to d from the codeword a. They are stored lexicographically.
- Backtrack search—a codeword from the considered space becomes part of the code if the distance stays equal to d and the lexicographic order of the columns of the code is preserved.
- When we are at the end of the search space, we check the size of the generated code to find if its size is bigger than what was previously found. The search continues by changing the codewords backward on the search tree.
3.2. Lexicographic Search
- Select the set of fixed codewords.
- The set of codewords that will be used for searching contains all the codewords that are at a distance exactly equal to d from the fixed codewords. They are stored lexicographically.
- A codeword from the considered space becomes part of the code if the distance stays exactly equal to d and the lexicographic order of the columns of the code is preserved.
- As an opposite to the previous method there is no step back. At the end of the search space we have the final generated code.
There are several variations:
- Automatically change the starting set of codewords to find the code with the larger size.
- Cyclically shift the search set that gives better results in some cases rather than the standard order.
3.3. Graph Clique Search
Searching for better values of can be considered a graph clique search problem.
Let us consider a graph with vertices related to a codeword with a length n and a weight d and a set of edges that connects a pair of vertices only if the distance between the codewords in these vertices is exactly equal to d. Then we can apply an algorithm for the maximum clique searching in such a graph.
A more detailed explanation of this approach, in general, can be found in [].
3.4. Construction with Extension
All search methods, described up to now, work only for small parameters or only in some special cases. That is why we combine them with extension methods. The essence is that the construction of the code can be performed by extension of an already known code. We can use this fact and try to extend all non-equivalent codes in order to find the optimal one.
4. Enumeration of Binary and Ternary Equidistant Codes
Definition 1.
Let’s define the equivalence between two codes as a set of transformations that translates one of the codes into the other. These transformations are exchange of coordinates in the code or permutation of symbols.
In Propositions 1, 2, 3 and Theorem 4 we present and proof some new combinatorial results related to enumeration of equidistant codes.
Proposition 1.
There exists an optimal equidistant code with parameters (n,q,n)q, n ≥ 2. This code is unique up to equivalence.
It can be derived from Theorem 3a.
Theorem 4.
Proof.
We may assume that all the codewords are ordered in a lexicographic way. □
- Without loss of generality 00…00000 and 00…00111 are from the code.
- If there are only zeros in the first n − 3 coordinates, then each of the remaining codewords is of type 0000ttt, where t is a random element from the alphabet. It is evident that Bq(n, 3) ≤ q.
- If in any of the first n − 3 coordinates there is a non-zero element, then without loss of generality 00…01012 is a codeword.
- If there are only zeros in the first n − 4 coordinates, then the code is (4, M, 3)q, for which it is well known that M ≤ 9 [].
- If n ≥ q + 1 and in any of the first n − 4 coordinates there is a non-zero element, then without loss of generality 00…10013 is from the code. We can see easily that a word with distance 3 from the already known four codewords is equivalent to 00…100014 and so on until we obtain the (q + 1,q,3)q code.
For instance, the obtained code for q = 9 is:
That is why if and , then and when and , then .
Construction 1.
Thecode can be derived fromcode A:.
Proposition 2.
Equidistant codes with parametersforandexist and are optimal. Each of the codes of this family is unique up to equivalence.
It follows from Theorem 4 and Construction 1.
Proposition 3.
Equidistant codes with parametersforandexist and are optimal. There are two families of such codes.
This follows from Theorem 4 and Construction 1.
There is a direct connection between equidistant codes and constant-weight codes. Let C be an equidistant constant-weight code for w = d and be an equidistant code. This relation is expressed by Theorem 3b. Also we can use code lengthening approach to construct an code C from code C′.
The next theorem follows from Theorem 1e, Theorem 1f and Theorem 3b.
Theorem 5.
Anyequidistant code C containscodes withcodewords.
There are two main problems: the existence and classification of equidistant codes.
The first problem is to construct all the codes with M codewords, which contain C′ as a sub-code. The search space will only be the vectors which are at a distance exactly d from code C′. We will only have to care about the distance between codewords. This is a maximum clique problem, and we use a backtrack search. In the q-ary case we can construct the graph whose vertices represent q-ary vectors of length n. We join three vertices by an edge if, and only if, the Hamming distance between the vectors is exactly d. Then what we are interested in is the value of , the size of the largest clique in this graph.
The second problem is to find all the inequivalent codes. Let and are ternary equidistant codes. Two codes and are equivalent if can be obtained from by: a permutation of the coordinates of the code, a permutation of the alphabet symbols in one or more coordinates, or any combination thereof. If we wish to compare two codes, we first convert those codes into graphs, and then check the graphs for isomorphism.
To obtain the classification results for q-ary equidistant codes, we use some theoretical and software tools [].
Table 1, Table 2 and Table 3 present the main new classification results for equidistant codes. For code generation, we use computer algorithms described in Section 3 that have proved their correctness in many similar cases. For example, using the same techniques in [] we found the exact values for , for many different values of q, n and d and all these results are also confirmed by combinatorial methods.
Table 1.
Classification of binary equidistant codes.
Table 2.
Classification of ternary equidistant codes.
Table 3.
(n,M,d)3 inequivalent equidistant codes.
All the results related to code enumeration are obtained using the combinatorial restrictions from Proposition 1, 2, 3 and Theorem 4 and proved computer methods for code enumerations similar to those described in []. The main idea of the algorithm is to transform the problem of code equivalence to the problem of isomorphism of binary matrices. Finally, in Table 3 are listed all non-equivalent codes found by computer algorithms and combinatorial considerations so their correctness could be easily checked.
Proposition 4.
There are # inequivalent equidistant codes with parametersfor. The codewords of thecodes are presented in Table 3 (up to equivalence).
The exact values for n = d are obtained by Theorem 3a.
5. Conclusions
In the paper, we use a specialized computer package QPlus to enumerate optimal binary and ternary equidistant codes for some parameters. Combinatorial methods are implemented in computer algorithms to restrict the number of codewords in the search sets.
The developed approach and techniques, related to the presented combinatorial objects and their application for digital data protection, are implemented in the project “Digital Accessibility for People with Special Needs: Methodology, Conceptual Models and Innovative Ecosystems”. The research in the project focuses mainly on semantic models for presenting unstructured data in the field of digital ecosystems and building an ontology for accessibility of people with disabilities. Some models for effective data organization and appropriate methods for creating, analysing, and protecting innovative accessible digital ecosystems are also explored. The research project develops methods for solving security problems by using discrete structures to ensure data security. Some of the codes considered in the paper are used for that protection.
Author Contributions
Data curation, T.T.; Investigation, G.B.; Methodology, G.B.; Resources, T.T.; Software, G.B.; Validation, T.T. All authors have read and agreed to the published version of the manuscript.
Funding
This research work has been partially supported by the National Science Fund of Bulgaria (scientific project “Digital Accessibility for People with Special Needs: Methodology, Conceptual Models and Innovative Ecosystems”), Grant Number KP-06-N42/4, 8 December 2020.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
Not applicable.
Conflicts of Interest
The authors declare no conflict of interest.
References
- Agrell, E.; Vardy, A.; Zeger, K. Upper bounds for constant-weight codes. IEEE Trans. Inform. Theory 2000, 46, 2373–2395. [Google Scholar]
- Brouwer, A.; Shearer, J.; Sloane, N.; Smith, W. A new table of constant weight codes. IEEE Trans. Inform. Theory 1990, 36, 1334–1380. [Google Scholar] [CrossRef]
- Chee, Y.; Ling, S. Constructions for q-ary constant-weight codes. IEEE Trans. Inform. Theory 2007, 53, 135–146. [Google Scholar] [CrossRef]
- Dai, P.; Wang, J.; Yin, J. Two series of equitable symbol weight codes meeting the Plotkin bound. Des. Codes Cryptogr. 2015, 74, 15–29. [Google Scholar] [CrossRef]
- Gashkov, I.; Taub, D. New Optimal Constant Weight Codes. Electron. J. Comb. 2007, 14, N13. [Google Scholar] [CrossRef]
- Ge, G.; Wu, D. Some new optimal quaternary constant weight codes. Sci. China Ser. F. 2005, 48, 192–200. [Google Scholar] [CrossRef]
- Krotov, D.S. On Diameter Perfect Constant-Weight Ternary Codes. Discret. Math. 2008, 308, 3104–3114. [Google Scholar] [CrossRef][Green Version]
- Östergård, P.; Svanström, M. Ternary constant weight codes. Electron. J. Comb. 2002, 9, R41. [Google Scholar] [CrossRef]
- Bogdanova, G.; Todorov, T.; Zinoviev, V. On construction of q-ary equidistant codes. Probl. Inf. Transm. 2007, 43, 13–36. [Google Scholar] [CrossRef]
- Boyvalenkov, P.; Delchev, K.; Zinoviev, D.V.; Zinoviev, V.A. On q-ary Codes with Two Distances d and d + 1. Probl. Inf. Transm. 2020, 56, 33–44. [Google Scholar] [CrossRef]
- Kathuria, A.; Arora, S.; Batra, S. On traceability property of equidistant codes. Discret. Math. 2017, 340, 713–721. [Google Scholar] [CrossRef]
- van Lint, J.H. A theorem on equidistant codes. Discret. Math. 1973, 67, 353–358. [Google Scholar] [CrossRef][Green Version]
- Semakov, N.V.; Zinoviev, V.A. Equidistant q-ary codes with maximal distance and resolvable balanced incomplete block designs. Probl. Peredachi Inf. 1968, 4, 3–10. [Google Scholar]
- Kaski, P.; Östergård, P. Classication Algorithms for Codes and Designs; Springer: Berlin, Germany, 2006. [Google Scholar]
- Knuth, D. Art of Computer Programming; Addison-Wesley Professional: Boston, MA, USA, 1998. [Google Scholar]
- Fu, F.; Klove, T.; Luo, Y.; Wei, V. On equidistant Constant Weight codes. In Proceedings of the WCC’2001 Workshop on Coding and Cryptography, Paris, France, 8–10 January 2001; pp. 225–232. [Google Scholar]
- Plotkin, M. Binary codes with specified minimum distance. IRE Trans. Inform. Theory 1960, 6, 445–450. [Google Scholar] [CrossRef]
- Delsarte, P. Bounds for unrestricted codes by linear programming. Philips Res. Rep. 1972, 27, 47–64. [Google Scholar]
- Östergård, P. A fast algorithm for the maximum clique problem. Discret. Appl. Math. 2002, 120, 195–205. [Google Scholar] [CrossRef]
- Bogdanova, G.; Todorov, T.; Todorov, V. QPlus—Computer package for coding theory research and education. Int. J. Comput. Math. 2011, 88, 443–451. [Google Scholar] [CrossRef]
- Bouyukliev, I. About the code equivalence. Adv. Coding Theory Cryptol. 2007, 3, 126–151. [Google Scholar]
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).