1. Introduction
Maximum Rank Distance (MRD) codes are a class of error-correcting codes that achieve the Singleton-like bound for rank distance, providing optimal performance for rank-metric error correction. Since their introduction by Delsarte in 1978 [
1], and further development by Gabidulin in 1985 [
2], MRD codes have become an essential tool in areas such as network coding, cryptography, and storage systems [
3].
Despite their importance, the construction of MRD codes remains challenging and open-ended. Classical constructions such as Gabidulin codes are well understood, but recent discoveries [
4] have shown the existence of other inequivalent MRD codes, demonstrating the potential for more comprehensive explorations.
However, most known MRD codes are obtained through algebraic constructions that do not always generalize well across all parameters. Moreover, recent works [
5,
6] have demonstrated that codes with desirable properties, such as higher generalized rank weights, can be constructed beyond the classical setting, motivating the search for new MRD codes.
In this paper, we propose a novel approach to constructing MRD codes using Particle Swarm Optimization (PSO). PSO is a population-based metaheuristic algorithm that excels at solving high-dimensional, complex optimization problems [
7]. By applying PSO to the combinatorial space of MRD codes, we aim to discover new codes and provide a systematic framework for their construction.
The remainder of this paper is organized as follows:
Section 2 reviews related work on MRD codes and optimization techniques.
Section 3 presents the necessary algebraic background.
Section 4 details the theoretical framework underlying our approach.
Section 5 introduces our PSO-guided construction method.
Section 6 discusses the results and limitations of our approach, and
Section 7 concludes the paper.
2. Related Work
Research on Maximum Rank Distance (MRD) codes began with the foundational work of Delsarte [
1], who introduced the rank metric and established fundamental properties of MRD codes. This work was further extended by Gabidulin [
2], who constructed a family of MRD codes using linearized polynomials, now known as Gabidulin codes.
Gabidulin codes remain the most extensively studied class of MRD codes due to their algebraic structure and optimality properties. However, for several decades, it was believed that these were the only MRD codes of practical interest. This perception changed with Sheekey’s discovery of the twisted Gabidulin codes [
4], which demonstrated the existence of inequivalent MRD codes, thereby opening new avenues for exploration.
Subsequent works have expanded the study of MRD codes by exploring their connections to semifield theory, generalized rank weights, and scattered subspaces [
5,
6,
8]. These studies have not only constructed new MRD codes but have also highlighted the diversity and richness of MRD code theory.
From an algorithmic perspective, attempts to discover new MRD codes have primarily focused on combinatorial searches and algebraic constructions. However, recent years have seen a growing interest in applying optimization algorithms to related problems. Evolutionary algorithms, such as Genetic Algorithms (GA), have demonstrated success in evolving block codes [
9,
10], suggesting their potential applicability to MRD code construction.
Particle Swarm Optimization (PSO) [
7], while well-established for continuous optimization, has also been adapted to combinatorial problems [
11]. Despite its extensive use in various domains, PSO has yet to be applied directly to the construction of MRD codes.
2.1. Evolution and Recent Advances in Rank Metric and MRD Code Constructions
The theory of rank-metric codes began with the foundational work of Delsarte in 1978, who introduced the concept of a rank metric on matrices and defined rank-metric codes as sets of matrices over a finite field with distance measured by the rank of their difference [
1]. In the same work, Delsarte also provided the first construction of Maximum Rank Distance (MRD) codes—those meeting the Singleton-like bound for the rank metric—via bilinear forms. This insight drew a parallel between MRD codes in the rank metric and MDS codes in the Hamming metric, establishing the existence of rare optimal codes under rank distance.
Building on this foundation, E. M. Gabidulin independently introduced in 1985 a general family of MRD codes now known as Gabidulin codes [
2]. His construction employed evaluations of linearized polynomials of the form
over extension fields, closely analogous to how Reed–Solomon codes use regular polynomials. These codes were shown to be MRD for all feasible parameters
, thereby generalizing Reed–Solomon codes to the rank-metric setting.
For decades following their introduction, Gabidulin codes and their variants remained the only known linear MRD codes in practical use. In 2005, Kshevetskiy and Gabidulin introduced a generalized version of Gabidulin codes, extending the structure and enhancing its suitability for cryptographic applications [
12]. This variant retained optimality while offering additional algebraic flexibility.
A major theoretical advancement occurred in 2016 when John Sheekey introduced the twisted Gabidulin codes—an entirely new family of MRD codes not equivalent to the classical Gabidulin construction [
4]. Sheekey’s method introduced a twisting term in the linearized polynomial structure, and his work revealed a deep connection between MRD codes and semifield theory. This broadened the landscape of MRD constructions and confirmed that MRD codes could arise from fundamentally different algebraic principles.
Subsequent research from 2018 onward has focused on expanding the catalog of MRD codes and understanding their structure in new parameter regimes. One significant direction has been the study of scattered subspaces (linear sets) in projective geometries, which correspond bijectively to rank-metric codes. In 2017, Csajbók et al. established that maximum scattered linear sets yield MRD codes, leading to new constructions beyond the classical
limitation [
13]. Following this, Bartoli et al. (2018) constructed a 3-dimensional MRD code for the case
with even
m, covering a previously inaccessible region in the parameter space not covered by Gabidulin codes [
5,
8].
In 2019, Sheekey proposed a generalized MRD code construction using skew polynomial rings, integrating both classical and twisted Gabidulin codes into a unified framework [
14]. This approach significantly expanded the known families of MRD codes, enabling new constructions for many parameter sets by leveraging the algebraic structure of non-commutative polynomials and semifields.
More recently, Alfarano et al. (2022/2023) introduced a new family of
-linear MRD codes of length
that are not direct sums of smaller MRD codes [
6]. These codes also demonstrated strictly larger generalized rank weights than known MRD codes, highlighting new structural richness and correcting the misconception that all MRD codes exhibit similar rank weight distributions.
Together, these developments represent a significant evolution in MRD code theory—from initial bilinear constructions to modern algebraic and geometric frameworks—and continue to open new pathways for theoretical advancement and practical applications in coding and cryptography.
2.2. Heuristic and Automated Searches for MRD Codes
Given the complexity of defining MRD codes algebraically, researchers have increasingly employed computational methods to find or verify new codes. For example, the classification of MRD codes with
by Csajbók et al. (2020) combined theoretical insights with computational searches [
13].
Despite these efforts, the use of heuristic algorithms, particularly PSO, for MRD code discovery remains largely unexplored. Genetic Algorithms (GA), however, have shown success in evolving block codes in the Hamming metric domain, suggesting that similar strategies might be effective for rank-metric code construction [
9,
10].
Particle Swarm Optimization (PSO), widely regarded for its efficiency in high-dimensional optimization, offers a promising avenue for MRD code discovery. While PSO has been adapted for combinatorial problems [
11], it has not yet been applied directly to MRD code construction. The adaptability of PSO to discrete and combinatorial problems suggests that it could be a powerful tool for exploring the space of MRD codes.
This paper builds upon these works by proposing a PSO-guided approach to MRD code construction, aiming to bridge the gap between algebraic theory and computational search techniques.
3. Algebraic Background
This section presents the necessary algebraic concepts and notation relevant to MRD codes and their construction. We begin with the rank metric, MRD codes, related algebraic structures, and definitions of Singleton bound and Singleton-like bound.
3.1. Rank Metric
A
rank-metric code is a subset of
(or, equivalently, a set of
matrices over
) used for error detection and correction in settings where the rank function defines the metric. Formally, a code is a collection of elements—called
codewords—that satisfy a minimum rank distance criterion. If
is linear, it forms a
k-dimensional subspace over
[
3].
A
codeword in a rank-metric code is an individual element of
, typically represented either as a vector in
or as a matrix in
via an
-linear isomorphism. The error-correcting capability of a code depends on the minimum rank distance between its distinct codewords [
3].
Let denote a finite field with q elements and let be an extension field of . A matrix can be viewed as a vector over or as a matrix over . The rank of A, denoted , is the dimension of the row or column space of A over .
The rank distance between two matrices
is defined as
A rank-metric code
is thus a set of matrices (or vectors) with a prescribed minimum rank distance
d between any two distinct codewords. The standard parameters of such a code are denoted
, where
n is the code length,
k is the dimension over
, and
d is the minimum rank distance [
3].
3.2. Singleton Bound and Singleton-like Bound
The classical Singleton bound, established for Hamming metric codes [
15], states that for a code of length
n, dimension
k, and minimum Hamming distance
d, the bound is given by
In the context of rank-metric codes, an analogous bound known as the Singleton-like bound was introduced by Delsarte [
1] and Gabidulin [
2]. For a rank-metric code
over
with parameters
, the Singleton-like bound is defined by
A rank-metric code that achieves this bound is called a Maximum Rank Distance (MRD) code.
This bound is often equivalently expressed in terms of code cardinality as
, which highlights the exponential trade-off between dimension and distance in rank-metric codes [
2,
3].
3.3. Maximum Rank Distance Codes
MRD codes are codes that achieve the Singleton-like bound for the rank metric. Such codes are considered optimal in the rank-metric setting, analogous to Maximum Distance Separable (MDS) codes in the Hamming metric. The study of MRD codes began with the foundational work of Delsarte [
1] and was expanded by Gabidulin [
2,
3], who constructed a family of MRD codes using linearized polynomials, now known as Gabidulin codes.
3.4. Gabidulin Codes
Gabidulin codes are a fundamental class of MRD codes constructed using evaluations of linearized polynomials over finite fields [
2,
3]. These codes are defined using polynomials of the form
where
and
. The codewords are generated by evaluating such polynomials at a fixed basis of
over
. Gabidulin codes are optimal under the rank metric and meet the Singleton-like bound.
3.5. Twisted Gabidulin Codes
In 2016, Sheekey introduced a new family of MRD codes known as twisted Gabidulin codes [
4]. Unlike classical Gabidulin codes, twisted Gabidulin codes are constructed by modifying the evaluation structure of Gabidulin codes, providing codes that are inequivalent to the classical Gabidulin construction. The discovery of twisted Gabidulin codes marked a significant breakthrough in the theory of MRD codes, demonstrating that there are other optimal codes beyond those known previously.
3.6. Generalized Gabidulin Codes
Generalized Gabidulin codes, introduced by Kshevetskiy and Gabidulin in 2005, extend the original Gabidulin construction by employing a broader set of linearized polynomials [
12]. These codes maintain optimality under the rank metric and have been applied extensively in cryptography and network coding.
3.7. Connections to Algebraic Structures
The construction of MRD codes is deeply connected to the algebraic structure of semifields and skew polynomial rings. Sheekey further generalized the construction of MRD codes in 2019 by employing skew polynomial rings to produce codes inequivalent to previous constructions [
14]. These developments highlight the richness of MRD code theory and its connections to various algebraic structures.
4. Theoretical Framework
In this section, we present the theoretical basis for applying Particle Swarm Optimization (PSO) to the construction of Maximum Rank Distance (MRD) codes. This involves formalizing the problem as a combinatorial optimization task and defining the relevant objective functions.
4.1. Particle Swarm Optimization
Particle Swarm Optimization (PSO) is a metaheuristic algorithm inspired by the collective behavior of swarms [
7,
11]. It operates by maintaining a population of candidate solutions (particles) that move through the search space based on their own experiences and the experiences of their neighbors.
The position of a particle is updated according to
where the velocity
is updated based on personal and social influences.
where
is the velocity,
is the position,
is the particle’s best-known position,
is the global best position,
w is the inertia weight,
and
are acceleration coefficients, and
.
This optimization approach will be adapted to explore the space of MRD codes in the proposed framework.
4.2. Problem Formulation
The problem of constructing an MRD code can be viewed as finding a subspace
such that all non-zero elements of
have rank distance at least
d[
2,
3,
4,
14]. Given the parameters
, we seek to find a generator matrix
such that
4.3. Objective Function
To apply PSO, we need to define a fitness function that evaluates the quality of candidate solutions. The fitness function is designed to maximize the minimum rank distance of the generated codewords because this value directly determines the code’s error-correcting power. According to Gabidulin’s formulation [
2,
3], a linear rank-metric code is MRD if the minimum rank distance between its nonzero codewords reaches the Singleton-like bound. Thus, optimizing this minimum distance is essential for constructing optimal codes.
Let
be a candidate code defined by a generator matrix
G. The fitness function
is given by:
The goal is to maximize
such that
. If the rank distance condition is met, secondary objectives, such as maximizing generalized rank weights, can be incorporated to further enhance the code’s properties [
13].
4.4. Search Space and Constraints
The search space for the PSO algorithm consists of all
generator matrices over
. Ensuring that the code satisfies the minimum rank distance requirement involves imposing constraints on the search space. The PSO algorithm must be adapted to handle these constraints by penalizing invalid solutions or using repair mechanisms to ensure feasibility. Strategies for constraint handling will be discussed in
Section 5.
4.5. Representation and Initialization
Each particle in the PSO algorithm represents a candidate generator matrix
G. The particles are initialized randomly within the search space, although seeding the population with known good structures (e.g., Gabidulin code generators) can enhance performance [
12].
The initialization process ensures that particles are spread throughout the space to promote diverse exploration.
4.6. PSO Algorithm for MRD Code Construction
The PSO algorithm iteratively updates the position of each particle according to the equations previously introduced. The fitness evaluation process ensures that particles approach valid MRD codes by optimizing rank distance.
This framework provides the theoretical foundation for developing a PSO-guided MRD code construction algorithm, which will be detailed in the next section.
5. Proposed PSO-Guided Construction Method
This section presents the proposed Particle Swarm Optimization (PSO)-guided method for constructing MRD codes. The algorithm leverages PSO’s global search capabilities to explore the space of rank-metric codes effectively.
5.1. Initialization
The PSO algorithm begins with the initialization of a population of N particles, each representing a candidate generator matrix . Initial matrices are generated randomly or by perturbing known good solutions (e.g., Gabidulin codes) to provide a diverse starting point.
5.2. Fitness Evaluation
The fitness of each particle is evaluated according to the objective function defined in
Section 4.2:
A particle is considered feasible if its fitness meets or exceeds the desired minimum rank distance d. Additionally, secondary objectives can be incorporated to improve generalized rank weights or other desirable properties.
5.3. Velocity and Position Update
The PSO algorithm updates the particles’ velocities and positions using the equations:
where: -
w is the inertia weight balancing exploration and exploitation. -
are acceleration coefficients guiding particles towards their personal best (
) and global best (
). -
are random variables sampled uniformly from
.
In the context of MRD codes, represents a generator matrix, and reflects modifications to that matrix. Matrix modifications can involve adding or replacing rows, modifying entries, or applying linear transformations.
5.4. Constraint Handling
Ensuring that the constructed code meets the rank distance requirement involves penalizing particles that violate the constraints. This can be achieved through a penalty function that reduces fitness for low-rank codewords or through repair operators that adjust the generator matrix.
5.5. Termination Criteria
The PSO algorithm continues iterating until a stopping criterion is met. Typical criteria include: - A maximum number of iterations is reached. - The best-found solution achieves the desired rank distance. - The improvement of the best-found solution falls below a certain threshold over a set number of iterations.
5.6. Algorithm Summary
The proposed algorithm can be summarized as follows:
|
Algorithm 1:PSO-Guided MRD Code Construction |
- 1:
Initialize population of N particles (generator matrices).
- 2:
Evaluate fitness of each particle.
- 3:
while termination criteria not met do
- 4:
for each particle do
- 5:
Update velocity and position using PSO equations.
- 6:
Evaluate fitness of the updated particle.
- 7:
Update personal and global bests if improved.
- 8:
end for
- 9:
end while
- 10:
Return the best-found generator matrix.
|
The Python implementation of this algorithm over finite fields, using the
galois library [
16], is available in the GitHub repository, which includes both the source code and documentation. The repository can be accessed at
https://github.com/behnamde/pso_mrd [
17].
6. Discussion
The proposed PSO-guided construction method presents a novel approach to discovering MRD codes by leveraging the global search capabilities of Particle Swarm Optimization. Unlike algebraic constructions that rely on theoretical derivations, PSO offers a flexible framework that can adapt to different parameter regimes where known constructions are unavailable.
6.1. Advantages of the PSO Approach
The key strengths of the proposed approach are:
Generality: PSO can be applied to a wide range of MRD code parameters, including those beyond the reach of classical constructions like Gabidulin codes.
Scalability: The algorithm can be scaled to higher dimensions by increasing the particle population or adjusting the fitness evaluation mechanism.
Adaptability: By incorporating domain-specific knowledge (e.g., initializing particles with Gabidulin-like structures), the search can be accelerated.
Exploratory Power: PSO’s population-based approach provides a balance between exploration and exploitation, making it suitable for traversing complex search spaces.
6.2. Limitations and Challenges
Despite its strengths, the proposed approach faces several challenges:
High Dimensionality: The search space for MRD codes grows exponentially with the size of the generator matrix, posing a challenge for convergence.
Fitness Evaluation Cost: Computing the rank distance for each particle is computationally expensive, especially in high-dimensional settings.
Lack of Guarantees: While PSO is effective in finding approximate solutions, it does not guarantee optimality. Additional heuristics may be required to refine solutions.
Sensitivity to Initialization: The quality of the initial population can significantly influence the convergence speed and final solution quality.
6.3. Future Work
Future research could explore the following directions:
Hybrid Algorithms: Combining PSO with algebraic techniques or other metaheuristics (e.g., Genetic Algorithms) could enhance search capabilities.
Improved Fitness Functions: Designing more effective fitness functions that incorporate generalized rank weights or other desired properties.
Parallelization: Exploiting parallel computing architectures to improve scalability and reduce computation time.
Applications: Applying the proposed approach to practical scenarios such as network coding, cryptography, or distributed storage systems.
7. Conclusions
In this paper, we have proposed a novel approach for constructing Maximum Rank Distance (MRD) codes using Particle Swarm Optimization (PSO). By formulating the MRD code construction problem as a combinatorial optimization task, the PSO algorithm provides a flexible and efficient mechanism for exploring the search space of generator matrices.
Our method leverages the ability of PSO to balance exploration and exploitation, making it well-suited to discovering MRD codes that may be difficult to obtain through traditional algebraic constructions. Furthermore, the proposed approach can be adapted to various parameter regimes, including those beyond the reach of classical constructions such as Gabidulin codes.
Despite the promising results, several challenges remain, particularly concerning the scalability of the approach and the design of effective fitness functions. Future work will focus on integrating algebraic insights into the PSO framework, enhancing the efficiency of the algorithm, and exploring practical applications of the constructed codes.
This work demonstrates that metaheuristic algorithms like PSO hold significant potential for advancing the theory and construction of MRD codes. We believe that further exploration in this direction will yield valuable insights and contribute to the broader field of coding theory.
References
- Delsarte, P. Bilinear forms over a finite field, with applications to coding theory. Journal of Combinatorial Theory, Series A 1978, 25, 226–241. [Google Scholar] [CrossRef]
- Gabidulin, E.M. Theory of codes with maximum rank distance. Problems of Information Transmission 1985, 21, 1–12. [Google Scholar]
- Gabidulin, E.M. Rank Codes; TUM.University Press: Technical University of Munich, Arcisstrasse 21, 80333 Munich, 2021. [Google Scholar] [CrossRef]
- Sheekey, J. A new family of linear maximum rank distance codes. Advances in Mathematics of Communications 2016, 10, 475–488. [Google Scholar] [CrossRef]
- Bartoli, D.; Giulietti, M.; Marino, G.; Polverino, O. Maximum Scattered Linear Sets and Complete Caps in Galois Spaces. Combinatorica 2015, 38, 255–278. [Google Scholar] [CrossRef]
- Alfarano, G.N.; Neri, A.; Zullo, F. Maximum Flag-Rank Distance Codes. arXiv preprint arXiv:2303.16653, arXiv:2303.16653 2023. [CrossRef]
- Kennedy, J.; Eberhart, R. Particle swarm optimization. In Proceedings of the Proceedings of ICNN’95-International Conference on Neural Networks. [CrossRef]
- Bartoli, D.; Csajbók, B.; Montanucci, M. On a conjecture about maximum scattered subspaces of Fq6×Fq6. arXiv preprint 2021. [Google Scholar] [CrossRef]
- Cuéllar, M.P.; Gómez-Torrecillas, J.; Lobillo, F.J.; Navarro, G. Genetic algorithms with permutation-based representation for computing the distance of linear codes. arXiv preprint 2020. [Google Scholar] [CrossRef]
- Azouaoui, A.; Belkasmi, M. Efficient Dual Domain Decoding of Linear Block Codes Using Genetic Algorithms. Journal of Electrical and Computer Engineering 2012. [Google Scholar] [CrossRef]
- van Zyl, J.P.; Engelbrecht, A.P. Set-Based Particle Swarm Optimisation: A Review. Mathematics 2023, 11, 2980. [Google Scholar] [CrossRef]
- Lunardon, G.; Trombetti, R.; Zhou, Y. Generalized twisted Gabidulin codes. Journal of Combinatorial Theory, Series A 2018, 159, 79–106. [Google Scholar] [CrossRef]
- Csajbók, B.; Marino, G.; Polverino, O.; Zullo, F. Maximum scattered linear sets and MRD-codes. Journal of Algebraic Combinatorics 2017, 46, 193–213. [Google Scholar] [CrossRef]
- Sheekey, J. MRD Codes: Constructions and Connections. In Combinatorics and Finite Fields: Difference Sets, Polynomials, Pseudorandomness and Applications; Schmidt, K.U.; Winterhof, A., Eds.; Radon Series on Computational and Applied Mathematics, De Gruyter, 2019. [CrossRef]
- Hamming, R.W. Error Detecting and Error Correcting Codes. The Bell System Technical Journal 1950, 29, 147–160. [Google Scholar] [CrossRef]
- Hostetter, M. Galois: A performant NumPy extension for Galois fields, 2020. GitHub repository containing implementation and documentation. Available at https://github.com/mhostetter/galois.
- Dehghani, B. PSO-Guided Construction of MRD Codes in Rank Metric, 2025. GitHub repository containing implementation and documentation. Available at https://github.com/behnamde/pso_mrd.
|
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 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 (http://creativecommons.org/licenses/by/4.0/).