Next Article in Journal
Enterprise Bankruptcy Prediction Model Based on Heterogeneous Graph Neural Network for Fusing External Features and Internal Attributes
Previous Article in Journal
KANJDP: Interpretable Temporal Point Process Modeling with Kolmogorov–Arnold Representation
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

PSO-Guided Construction of MRD Codes for Rank Metrics

by
Behnam Dehghani
1,*,† and
Amineh Sakhaie
2,†
1
Department of Mechanical Engineering, University of Minho, Campus of Azurém, 4800-058 Guimarães, Portugal
2
Mathematics Department, Faculty of Science, Lisbon University, 1649-004 Lisbon, Portugal
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Mathematics 2025, 13(17), 2756; https://doi.org/10.3390/math13172756
Submission received: 9 April 2025 / Revised: 16 August 2025 / Accepted: 22 August 2025 / Published: 27 August 2025
(This article belongs to the Section E1: Mathematics and Computer Science)

Abstract

Maximum Rank-Distance (MRD) codes are a class of optimal error-correcting codes that achieve the Singleton-like bound for rank metric, making them invaluable in applications such as network coding, cryptography, and distributed storage. While algebraic constructions of MRD codes (e.g., Gabidulin codes) are well-studied for specific parameters, a comprehensive theory for their existence and structure over arbitrary finite fields remains an open challenge. Recent advances have expanded MRD research to include twisted, scattered, convolutional, and machine-learning-aided approaches, yet many parameter regimes remain unexplored. This paper introduces a computational optimization framework for constructing MRD codes using Particle Swarm Optimization (PSO), a bio-inspired metaheuristic algorithm adept at navigating high-dimensional, non-linear, and discrete search spaces. Unlike traditional algebraic methods, our approach does not rely on prescribed algebraic structures; instead, it systematically explores the space of possible generator matrices to identify MRD configurations, particularly in cases where theoretical constructions are unknown. Key contributions include: (1) a tailored finite-field PSO formulation that encodes rank-metric constraints into the optimization process, with explicit parameter control to address convergence speed and global optimality; (2) a theoretical analysis of the adaptability of PSO to MRD construction in complex search landscapes, supported by experiments demonstrating its ability to find codes beyond classical families; and (3) an open-source Python toolkit for MRD code discovery, enabling full reproducibility and extension to other rank-metric scenarios. The proposed method complements established theory while opening new avenues for hybrid metaheuristic–algebraic and machine learning–aided MRD code construction.

1. Introduction

Maximum Rank-Distance (MRD) codes are optimal error-correcting codes for the rank metric, achieving the Singleton-like bound and offering maximum error resilience in rank-metric channels. Since the foundational works of Delsarte in 1978 [1] and Gabidulin in 1985 [2], they have been central to applications in network coding, cryptography, and distributed storage [3].
Despite their theoretical appeal, MRD code construction remains challenging. Classical families, such as Gabidulin and their generals [4], cover many, but not all, parameter regimes. Recent advances, including twisted Gabidulin [5], generalized twisted Gabidulin [6], scattered-subspace constructions [7], and Maximum Flag-Rank Distance codes [8], have revealed inequivalent MRD codes with distinct structural and weight properties. Yet, a comprehensive existence theory for arbitrary field sizes and dimensions is still lacking.
In parallel, computational approaches have emerged as a complementary route to algebraic methods. Classification efforts for small parameters [9] and heuristic searches, most notably genetic algorithms for Hamming-metric codes [10,11], have shown that metaheuristics can effectively navigate discrete code spaces. Deep-learning-based code design [12,13] and learning-driven inverse problem solving [14] further illustrate the potential of data-driven exploration when explicit constructions are elusive. However, to our knowledge, Particle Swarm Optimization (PSO) [15,16] has not been applied to MRD code construction.
PSO is a population-based metaheuristic known for efficiently exploring high-dimensional, nonlinear, and multimodal search spaces. By encoding generator matrices directly over finite fields and embedding rank-metric constraints into the objective, PSO can adaptively balance exploration (discovering new code structures) and exploitation (refining promising candidates). This makes it especially attractive for MRD regimes where algebraic constructions are unknown, convergence behavior must be analyzed, and global optima are difficult to guarantee.
In this work, we:
  • Formulate MRD code construction as a constrained combinatorial optim problem over F q k × n .
  • Design a finite-field PSO variant with rank-aware velocity clamping, adaptive penalties, and structured seeding from Gabidulin codes.
  • Provide a theoretical analysis of the PSO-guided search process in the MRD code context, including its adaptability to high-dimensional and nonlinear search spaces.
  • Release an open-source Python implementation to support reproducibility and to facilitate further exploration of MRD code existence in uncharted parameter regimes.
This contribution bridges a gap between algebraic theory and heuristic search, positioning PSO as a flexible, extensible framework for MRD code discovery and potentially inspiring analogous applications in machine learning-aided code design.

2. Related Work

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 [1], who introduced the rank metric and exhibited MRD codes via bilinear forms, in parallel with the role that MDS codes play in the Hamming metric [17]. Gabidulin then provided a general polynomial-evaluation construction [2], later extended in scope and applications [3,4].
Beyond these classical families, inequivalent MRD codes arise from twisted and generalized twisted constructions [5,6], as well as skew polynomial frameworks [18]. Geometric methods based on scattered linear sets yield additional MRD families [7], and there are explicit constructions outside the n m regime such as the n = 3 m 2 case for even m [19,20]. Recent work on maximum flag-rank distance (MFRD) codes provides new linear spaces with larger generalized rank weights and new structural invariants [8]. In a related direction, MRD convolutional codes have been investigated as a streaming or time-varying analogue of block MRD codes; the recent work by Napp et al. [21] constructs novel classes of such convolutional codes for a broad set of parameters, extending MRD theory into the convolutional domain.
Concurrently, several construction paradigms continue to expand the frontier. A 2024 switching framework builds MRD codes via puncturing and product operations, enabling transitions among inequivalent families [22]. In the sum-rank setting, which unifies Hamming and rank metrics, there are fresh explicit MSRD constructions and decoding-friendly variants [23,24,25]. Very recent preprints report additional MRD and sum-rank constructions that leverage subspace designs and orthogonal space methods [26].
The cumulative effect of these developments is a significant expansion of MRD code theory, from bilinear and polynomial constructions to geometric, algebraic-combinatorial, and now convolutional frameworks, with ongoing discoveries continuing to reshape the boundaries of known existence regions.

2.2. Heuristic, Learning-Based, and Automated Searches for MRD Codes

Computational search complements algebraic theory where existence questions remain open. Classification for small parameters combines structure with exhaustive or guided enumeration [9]. In the broader coding landscape, metaheuristics such as genetic algorithms have been effective for discovering or approximating good codes in Hamming settings [10,11], suggesting portability to rank-metric search.
Learning-based design has emerged for linear codes, with neural constructions and optimization-oriented frameworks that learn generator structure [12,13]. Although most such results target Hamming or Euclidean metrics, they indicate a pathway for data-driven construction in rank-metric problems. Complementary perspectives from inverse-problem machine learning also demonstrate how learned models can replace explicit derivations when closed-form structures are unavailable [14]. Beyond pure code design, AI-driven rank-metric evaluation has also been explored in other domains; for example, Chen et al. [27] implemented an AI-based MRD evaluation and prediction model (albeit for clinical data), illustrating the broader applicability of machine-learning MRD frameworks across fields.
Within this landscape, Particle Swarm Optimization [15,16] remains underexplored for MRD construction. Its balance of exploration and exploitation in high-dimensional, nonlinear spaces motivates the PSO-guided framework we develop in this work. Table 1 includes a comprehensive comparison.

3. Algebraic Background

This section reviews the concepts and notation that underlie maximum-rank-distance (MRD) codes and their construction. We also formalize the optim target that will be addressed by the PSO framework in later sections.

3.1. Rank Metric

Let F q denote the finite field with q elements, where q is a prime power. The rank metric measures the distance between two matrices, or equivalently between vectors on an extension field, by the rank of their difference:
d ( A , B ) = rank F q ( A B ) , A , B F q m × n .
A rank-metric code  C is a subset of F q m × n used for error detection and correction when this metric is applied. Its minimum rank distance is
d r = min A , B C A B rank F q A B .
The code C is called F q -linear if it is a k-dimensional subspace of F q m × n with k { 1 , , m n } . If C is F q -linear it admits the generator-matrix form
C = G u : u F q k × 1 , G F q k × n .
Each c C is a codeword, viewed either as a vector over F q or, via a fixed F q -linear isomorphism Φ : F q m n F q m × n , as an m × n matrix over the base field.

3.2. Singleton Bound and Singleton-like Bound

Classical Hamming case. For a Hamming-metric block code of length n, dimension k, and minimum distance d, the classical Singleton bound is [17]:
d n k + 1 .
Rank-metric analogue. For C F q m × n with minimum rank distance d and F q -dimension k, Delsarte and Gabidulin [1,2,3] proved the Singleton-type bounds:
| C | q m ( n d + 1 ) ,
k m ( n d + 1 ) ,
d min { m , n } k + 1 .

3.3. Maximum Rank-Distance (MRD) Codes

A code C F q m × n is an MRD code when it achieves equality in (7):
| C | = q m ( n d + 1 ) k = m ( n d + 1 ) d = min { m , n } k + 1 .
Lemma 1. 
Let G F q k × n generate a F q -linear code C . Then, C is MRD if and only if
rank F q ( Y G ) = k for every Y F q k × n with rank F q ( Y ) = k .
Hence, an MRD code can be identified by the full-rank preservation of its generator matrix under premultiplication by any full-rank k × n matrix over the base field [3].

3.4. Gabidulin Codes

Let q be a prime power and m , n , k N with k n m (since for Gabidulin codes the length n must not exceed the extension degree m, and the dimension k must not exceed the length) [3]. Choose
α = α 1 α 2 α n F q 1 × n , with entries F q - linearly independent .
For a q-linearized polynomial
P ( x ) = i = 0 k 1 a i x [ i ] , x [ i ] : = x q i , a i F q ,
define the evaluation map:
Ev α ( P ) = P ( α 1 ) P ( α 2 ) P ( α n ) F q 1 × n .
The Gabidulin code is then:
Gab q ( n , k , m ) = Ev α ( P ) : deg q ( P ) < k ,
forming an F q -linear [ n , k , d ] q m code with
d = n k + 1 , Gab q ( n , k , m ) = q m k .
Its generator matrix is the Moore (or σ -Vandermonde) matrix:
G Gab = α 1 [ 0 ] α 2 [ 0 ] α n [ 0 ] α 1 [ 1 ] α 2 [ 1 ] α n [ 1 ] α 1 [ k 1 ] α 2 [ k 1 ] α n [ k 1 ] F q k × n .
Since G Gab satisfies Lemma 1, Gab q ( n , k , m ) is MRD.

3.5. Optim Viewpoint for MRD Construction

In the context of this work, the construction problem can be expressed as:
max G F q k × n min u F q k { 0 } rank F q Φ ( G u s . t . rank F q ( G ) = k .
The MRD condition is achieved when the inner minimum equals the bound in (7). This formal directly motivates the PSO-based search strategy described in the theoretical framework.

3.6. Remark on Computational Complexity

Evaluating (16) exactly requires computing q k 1 1 rank operations on m × n matrices per candidate G, each costing O ( min ( m , n ) 3 ) with Gaussian elimination. This high cost underlines the need for efficient search heuristics.

4. Theoretical Framework

This section lays out the foundations for using PSO to construct MRD codes. We first summarize PSO, then formulate code construction as a constrained combinatorial optim problem, and finally discuss its theoretical suitability for this task.

4.1. Particle Swarm Optim

Particle swarm optim (PSO) is a population-based metaheuristic inspired by the collective motion of biological swarms [15,16]. A swarm of S particles explores the search space; particle i keeps track of its position x i , velocity v i , personal best p i , and global best g found so far.
The standard updates are
v i ( t + 1 ) = w v i ( t ) + c 1 r 1 , i ( t ) p i x i ( t ) + c 2 r 2 , i ( t ) g x i ( t ) ,
x i ( t + 1 ) = x i ( t ) + v i ( t + 1 ) ,
where r 1 , i ( t ) , r 2 , i ( t ) i . i . d . U ( 0 , 1 ) are independent scalars (or component-wise vectors) drawn anew each iteration; w is the inertia weight; and c 1 , c 2 are the cognitive and social acceleration coefficients.

4.2. Problem Formulation

Let [ n , k , d ] q m be the target parameters of an MRD vector code. We seek a generator matrix G F q k × n such that the F q -linear code C given by (3) attains minimum rank distance
d min ( C = min u F q k { 0 } rank F q Φ ( G u d ,
where Φ : F q m n F q m × n is the fixed F q -linear isomorphism that converts each length-n vector over the extension field into its m × n matrix representation [3]. The rank in (19) is taken over F q on this unfolded matrix.
The construction task can thus be expressed as the optim problem (16) in Section 3, with the additional MRD constraint from (7).

4.3. Objective Function

By (8), a linear rank-metric code is MRD precisely when its minimum rank distance equals the Singleton-like bound. We therefore define the fitness
F ( G ) = min u F q m k { 0 } rank F q Φ ( G u
and maximize F ( G ) subject to F ( G ) d . If multiple candidates achieve the primary target, secondary criteria such as larger generalized rank weights [6] or sparsity of G can be incorporated.

4.4. Search Space and Constraints

The search domain consists of all full-rank k × n matrices over F q . Constraint handling is implemented via (i) a penalty term reducing the score when F ( G ) < d , and (ii) a repair routine that replaces dependent rows with random full-rank ones if a velocity update introduces rank deficiency. These mechanisms help maintain feasibility while allowing occasional exploration into near-feasible regions.

4.5. Representation and Initial

Each PSO particle represents a candidate generator matrix G in (20). Positions are initialized either: (a) uniformly at random over F q , subject to full rank; or (b) as low-rank perturbations of Gabidulin matrices [10,11,16] to seed the swarm with known good structures while preserving diversity.

4.6. Theoretical Adaptability of PSO

PSO is well-suited for MRD construction for several reasons:
  • High-dimensional exploration: Generator matrices over F q can be large, making the search space exponential in k n . PSO’s population-based search can maintain coverage across many distant regions simultaneously.
  • Nonlinear, discrete landscape: The rank-distance function is highly non-smooth and discrete. Probabilistic velocity updates allow PSO to traverse such landscapes without relying on gradient information.
  • Convergence control: By adjusting w, c 1 , c 2 , and velocity clamping, the algorithm can trade exploration for exploitation, mitigating premature convergence to sub-optimal matrices.
  • Global optimality considerations: While PSO does not guarantee global optima, the combination of structured seeding, adaptive penalties, and rank-based diversity control reduces the risk of stagnation in poor local optima.

4.7. Parameter Roles and Selection

The main PSO parameters are:
  • S: swarm size, typically scaled with problem dimension k n .
  • T max : maximum iterations, influencing total search effort.
  • w: inertia weight, controlling momentum. Larger w promotes exploration, while smaller w promotes convergence.
  • c 1 , c 2 : cognitive and social coefficients, balancing attraction to personal vs. global bests.
  • r max : velocity-rank clamp, limiting disruptive changes to generator matrices.
Stable parameter regions from PSO theory [28,29,30] can be adapted to the finite-field setting by treating velocity updates as probabilistic component changes rather than real-valued vectors.

4.8. PSO Algorithm for MRD Code Construction

At every iteration, the swarm updates velocities and positions via (17) and (18). After each move, the fitness (20) is evaluated; personal and global bests are updated accordingly, steering the particles toward matrices satisfying the MRD property.
This completes the theoretical basis. Section 5 translates these ideas into a concrete PSO-guided construction algorithm.

5. Proposed PSO-Guided Construction Method

This section details the PSO-guided method for constructing MRD codes, emphasizing the finite-field adaptations and constraint-handling strategies that differentiate it from a vanilla PSO. The method directly implements the optim model in (16).

5.1. Initial

The swarm consists of N particles, each representing a k × n generator matrix G ( j ) F q k × n . Two complementary strategies ensure both diversity and structural quality:
(i) Purely random sampling. For approximately half of the particles, entries are drawn independently from F q until rank F q ( G ) = k . A practical procedure is:
  • Fix a normal basis { β , β [ q ] , , β [ q m 1 ] } of F q m .
  • Fill a k × n array with uniformly random F q elements.
  • Map each m-tuple of F q -coefficients to a field element i = 0 m 1 a i β [ q i ] F q m .
  • If full F q -rank is not achieved, repeat.
(ii) Perturbed Gabidulin seeds. The remaining particles are seeded as
G ( j ) = G Gab + R ( j ) , rank F q ( R ( j ) r max k ,
where G Gab is a Gabidulin generator [3] and R ( j ) = a ( j ) b ( j ) with a ( j ) F q k × 1 and b ( j ) F q n × 1 . This preserves the known MRD structure while introducing controlled diversity.
Initial velocities v ( j ) ( 0 ) F q k × n are generated independently and uniformly, ensuring no bias toward initial positions.

5.2. Fitness Evaluation

Each particle’s primary fitness is F ( G ) from (20). Feasible particles satisfy F ( G ) d ; ties are resolved lexicographically:
  • Maximize F ( G ) ,
  • Then maximize the second-smallest rank (proxy for the second generalized rank weight),
  • Then minimize the Hamming weight of G to favor sparsity.
This composite score is applied consistently to personal- and global-best updates.

5.3. Velocity and Position Update

Equations (17) and (18) govern updates, adapted for F q :
  • Addition is over F q , component-wise.
  • Random scalars r 1 , i , r 2 , i define per-entry probabilities of applying cognitive/social terms.
  • Velocity rank is clamped to rank F q ( v i ) r max to avoid destructive changes.

5.4. Constraint Handling

Two mechanisms ensure feasibility:
  • Penalty: subtract λ [ d F ( G ) ] when F ( G ) < d , with λ increasing periodically to discourage persistent infeasibility.
  • Repair: if rank F q ( G ) < k , iteratively replace dependent rows with random full-rank rows.

5.5. Termination Criteria

Stop if:
  • t = T max ,
  • A particle attains F ( G ) = d and meets all secondary criteria,
  • No global-best improvement for τ iterations, τ 0.1 T max .

5.6. Algorithm Summary

Step Interaction Recap. The algorithm begins by generating a diverse swarm of candidate generator matrices, with half sampled randomly under full-rank constraints and the remainder obtained by low-rank perturbations of known Gabidulin codes. This initial ensures a balance between structural guidance and exploratory diversity. Each particle is assigned a random finite-field velocity, initiating movement through the search space. At each iteration, velocities are updated using finite-field PSO rules, where inertia, cognitive, and social terms control the trade-off between exploration and exploitation. Velocity-rank clamping limits disruptive changes, while penalties dynamically reduce the fitness of infeasible solutions to steer the swarm toward MRD-compliant regions. After each position update, repair routines restore full rank when necessary, ensuring particles remain viable candidates. This interplay between guided initial, controlled velocity updates, adaptive penalties, and corrective repair maintains both feasibility and diversity, enabling the swarm to converge toward high-quality MRD generator matrices. The process terminates when a stopping condition is met, such as reaching the maximum iterations, satisfying all MRD criteria, or stalling in improvement, and the best-found generator matrix is returned as the output (Algorithm 1).
Algorithm 1 Finite-Field PSO for MRD Code Construction
1:
Initialize N particles: half random, half perturbed Gabidulin seeds.
2:
Assign random finite-field velocities.
3:
for t = 1 to T max  do
4:
    for each particle j do
5:
        Evaluate F ( G ( j ) ; apply tie-breakers if F ( G ( j ) d .
6:
        Update personal best p j if improved.
7:
    end for
8:
    Identify global best g.
9:
    for each particle j do
10:
        Update v ( j ) via (17) (finite-field form).
11:
        Rank-clamp v ( j ) if needed.
12:
        Update G ( j ) G ( j ) + v ( j ) over F q .
13:
        Apply repair if rank ( G ( j ) < k .
14:
    end for
15:
    if termination criterion met then break.
16:
    end if
17:
end for
18:
return best-found G * .

5.7. Implementation and Reproducibility

A complete Python (Python 3.10) implementation, mirroring Algorithm 1, is provided at https://github.com/behnamde/pso_mrd (accessed on 7 April 2025) [31], using the galois library [32] for F q arithmetic (Dependencies: numpy (≥1.24), galois (≥0.4)). Key features include:
  • Exact reproduction of finite-field PSO updates, rank clamping, and probabilistic velocity application.
  • Configurable seeding, penalty scheduling, and repair.
  • Parameter exposure ( N , T max , w , c 1 , c 2 , r max , λ , τ ) for systematic study.
  • Deterministic mode via random seed control for reproducibility.
This codebase enables researchers to replicate the results, experiment with parameter regimes, and extend the framework to related rank- or sum-rank-metric problems.

5.8. Computational Complexity

We summarize the cost of one PSO iteration over N particles for the proposed finite-field scheme. Throughout, let
m , n , k N , q a prime power , d the target rank distance .
Denote by C mul ( q m ) the unit cost of a multiplication in F q m and by C rank ( m , n ) the cost of computing the rank of an m × n matrix over F q using Gaussian elimination:
C rank ( m , n ) = O min { m , n } m n = O ( m n 2 ) , n m , O ( n m 2 ) , m < n .

5.8.1. Per-Particle Fitness Evaluation

For a candidate G F q k × n , the fitness F ( G ) in (20) requires:
  • Forming G u in F q m n : O k n C mul ( q m ) .
  • Unfolding via Φ : O ( m n ) in F q .
  • Rank computation over F q : C rank ( m , n ) from (22).
If evaluated exactly over all nonzero u , the number of candidates is Q : = q m k 1 when u is taken over F q m . Hence, the worst-case exact per-particle fitness cost is:
O Q · k n C mul ( q m ) + m n + C rank ( m , n ) .
In practice, a fixed probe budget T u Q with early stopping is used, giving:
O T u · k n C mul ( q m ) + m n + C rank ( m , n ) .

5.8.2. Per-Particle PSO Update

Velocity and position updates over F q are linear in the number of entries:
O ( k n ) .
Rank-clamping of v costs O ( min { k , n } k n ) unless low-rank factored forms are used, in which case:
O r max ( k + n ) ,
with r max the velocity-rank bound.

5.8.3. Repair and Feasibility Checks

Checking rank ( G ) matches (22); replacing dependent rows costs the same order.

5.8.4. Total Per-Iteration Cost

For dense velocities and probe budget T u , the dominant cost is fitness:
Per - iteration : O ( N T u · k n C mul ( q m ) + m n + C rank ( m , n ) + N · min { k , n } k n ) , Total runtime over T max : O ( T max N T u · k n C mul ( q m ) + m n + C rank ( m , n ) + T max N · min { k , n } k n ) .

5.8.5. Memory Complexity

Positions and velocities in dense form require:
O ( N k n ) field elements ,
while low-rank velocity storage with bound r max uses:
O N r max ( k + n ) .

5.8.6. Remarks

  • Exact fitness (23) is infeasible for large k; the practical form (24) dominates runtime.
  • For moderate m , n , C rank ( m , n ) is the main bottleneck.
  • Low-rank velocity factor (26) can yield substantial speed-ups in large ( k , n ) regimes.

6. Discussion

The proposed PSO-guided construction method introduces a metaheuristic framework for identifying maximum-rank-distance (MRD) codes by leveraging the global search capabilities of particle swarm optim (PSO). Unlike purely algebraic methods, such as Gabidulin’s construction [2,3], which rely on explicit closed-form derivations, PSO offers a flexible, data-driven approach that remains applicable when no known theoretical construction exists or when the target parameters fall outside established families.
In addition to the qualitative advantages discussed throughout this work, Table 1 in Section 2 provides a structured comparison between our PSO-guided framework, classical algebraic constructions, alternative metaheuristics, and recent AI-based approaches. This comparison underscores PSO’s ability to operate in parameter regimes where algebraic existence results are unknown, while also maintaining flexibility to incorporate structural seeding and advanced constraint-handling. In contrast to algebraic techniques bound by proven construction theorems and learning-based frameworks dependent on extensive training data, our PSO formulation combines rank-metric awareness with adaptive exploration and exploitation, enabling efficient search over vast high-dimensional discrete spaces.

6.1. Advantages of the PSO Approach

  • Generality: Applicable to a wide range of ( m , n , k , q ) parameters, including those beyond classical Gabidulin families [5,6,8] and more recent convolutional MRD frameworks [21].
  • Scalability: Handles larger problem sizes by tuning swarm size N, inertia weight w, and evaluation frequency. Complexity analysis in Section 5.8 shows that low-rank velocity factor can substantially mitigate the O ( m n 2 ) rank-computation bottleneck.
  • Adaptability: Can seamlessly incorporate domain knowledge, such as Gabidulin-based seeding, without constraining the search to a narrow solution family.
  • Exploratory Capability: Maintains population diversity, balancing the discovery of new code structures with the refinement of promising candidates in the inherently non-convex MRD search landscape.

6.2. Limitations and Challenges

  • Combinatorial Explosion: The search space scales exponentially with k n , making convergence more challenging as problem size increases.
  • Fitness Evaluation Cost: Computing F ( G ) in (20) for all non-zero u is expensive, with complexity analysis in Section 5.8 confirming that rank evaluation dominates runtime for most parameter sets.
  • No Global-Optimality Guarantee: As with other metaheuristics, PSO yields high-quality solutions but cannot guarantee global optimality; algebraic verification remains essential.
  • Initial Sensitivity: Poor diversity in the initial swarm can lead to premature convergence, underscoring the value of structured seeding.

6.3. Future Work

  • Hybrid Methods: Combine PSO with algebraic insights or complementary metaheuristics (e.g., genetic algorithms [10,11]) to increase robustness.
  • Enhanced Objectives: Extend F ( G ) in (20) to capture generalized rank weights [6], decoding complexity, or convolutional rank constraints [21].
  • Parallel: Use GPU and distributed architectures to accelerate velocity updates and rank evaluations, as suggested by the complexity model in Section 5.8.
  • Applied Evaluation: Deploy discovered codes in network coding, distributed storage, or AI-driven MRD evaluation frameworks [27] to assess performance under realistic channel models.
  • Quantum-Inspired Optim: Investigate PSO variants leveraging quantum principles for potential acceleration in discrete combinatorial search spaces.

7. Conclusions

We have formulated MRD-code construction as a constrained combinatorial optim problem over F q k × n and proposed a PSO-based algorithm tailored to the finite-field rank-metric setting. The framework incorporates rank-aware velocity clamping, adaptive penalties, and structured seeding from Gabidulin codes, allowing it to search efficiently in high-dimensional, non-linear, discrete spaces.
The method offers a general, extensible approach that can explore MRD parameter regimes not covered by existing algebraic constructions, including convolutional and emerging AI-driven contexts. While its adaptability and exploratory capability make it a promising addition to the MRD-construction toolbox, the approach still faces scalability challenges due to the combinatorial size of the search space and the high cost of exact fitness evaluation. The complexity analysis in Section 5.8 quantifies these bottlenecks and highlights potential optims, such as low-rank velocity updates and parallel evaluation.
Future research will focus on integrating deeper algebraic structure into the search, refining constraint-handling mechanisms, and exploring hybrid frameworks that combine PSO with other metaheuristics or machine-learning models. Such developments have the potential to further bridge the gap between theoretical code design and computational discovery, expanding the range of MRD codes available for applications in communication, cryptography, and storage systems.

Author Contributions

Methodology, B.D. and A.S.; Software, B.D.; Formal analysis, B.D. and A.S.; Writing—original draft, B.D.; Writing—review & editing, A.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The data presented in this study are openly available at https://github.com/behnamde/pso_mrd (accessed on 7 April 2025).

Acknowledgments

The authors would like to thank João Pedro Mendonça from the Department of Mechanical Engineering at the University of Minho, for his valuable supervision, insightful guidance, and continuous support throughout this research.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Delsarte, P. Bilinear forms over a finite field, with applications to coding theory. J. Comb. Theory Ser. A 1978, 25, 226–241. [Google Scholar] [CrossRef]
  2. Gabidulin, E.M. Theory of codes with maximum rank distance. Probl. Inf. Transm. 1985, 21, 1–12. [Google Scholar]
  3. Gabidulin, E.M. Rank Codes; Sidorenko, V., Ennemoser, C., Eds.; Sidorenko, V., Translator; Technical University of Munich Press: Munich, Germany, 2021. [Google Scholar] [CrossRef]
  4. Kshevetskiy, A.; Gabidulin, E. The new construction of rank codes. In Proceedings of the International Symposium on Information Theory, 2005. ISIT 2005, Adelaide, SA, Australia, 4–9 September 2005; pp. 2105–2108. [Google Scholar] [CrossRef]
  5. Sheekey, J. A new family of linear maximum rank distance codes. Adv. Math. Commun. 2016, 10, 475–488. [Google Scholar] [CrossRef]
  6. Lunardon, G.; Trombetti, R.; Zhou, Y. Generalized twisted Gabidulin codes. J. Comb. Theory Ser. A 2018, 159, 79–106. [Google Scholar] [CrossRef]
  7. Csajbók, B.; Marino, G.; Polverino, O.; Zullo, F. Maximum scattered linear sets and MRD-codes. J. Algebr. Comb. 2017, 46, 193–213. [Google Scholar] [CrossRef]
  8. Alfarano, G.N.; Neri, A.; Zullo, F. Maximum flag-rank distance codes. J. Comb. Theory Ser. A 2024, 207, 105908. [Google Scholar] [CrossRef]
  9. Csajbók, B.; Marino, G.; Polverino, O.; Zhou, Y. MRD codes with maximum idealizers. Discret. Math. 2020, 343, 111985. [Google Scholar] [CrossRef]
  10. Cuéllar, M.; Gómez-Torrecillas, J.; Lobillo, F.; Navarro, G. Genetic algorithms with permutation-based representation for computing the distance of linear codes. Swarm Evol. Comput. 2021, 60, 100797. [Google Scholar] [CrossRef]
  11. Azouaoui, A.; Belkasmi, M. Efficient Dual Domain Decoding of Linear Block Codes Using Genetic Algorithms. J. Electr. Comput. Eng. 2012. [Google Scholar] [CrossRef]
  12. Choukroun, Y.; Wolf, L. Learning linear block error correction codes. In Proceedings of the 41st International Conference on Machine Learning, Vienna, Austria, 21–27 July 2024. [Google Scholar] [CrossRef]
  13. Huang, L.; Zhang, H.; Li, R.; Ge, Y.; Wang, J. AI Coding: Learning to Construct Error Correction Codes. IEEE Trans. Commun. 2020, 68, 26–39. [Google Scholar] [CrossRef]
  14. Gao, Y.; Liu, H.; Wang, X.; Zhang, K. On an artificial neural network for inverse scattering problems. J. Comput. Phys. 2022, 448, 110771. [Google Scholar] [CrossRef]
  15. Kennedy, J.; Eberhart, R. Particle swarm optimization. In Proceedings of the ICNN’95-International Conference on Neural Networks, Perth, WA, Australia, 27 November–1 December 1995; Volume 4, pp. 1942–1948. [Google Scholar] [CrossRef]
  16. van Zyl, J.P.; Engelbrecht, A.P. Set-Based Particle Swarm Optimisation: A Review. Mathematics 2023, 11, 2980. [Google Scholar] [CrossRef]
  17. Hamming, R.W. Error Detecting and Error Correcting Codes. Bell Syst. Tech. J. 1950, 29, 147–160. [Google Scholar] [CrossRef]
  18. Sheekey, J. 13. MRD codes: Constructions and connections. In Combinatorics and Finite Fields; Schmidt, K.U., Winterhof, A., Eds.; De Gruyter: Berlin, Germany, 2019; pp. 255–286. [Google Scholar] [CrossRef]
  19. Bartoli, D.; Giulietti, M.; Marino, G.; Polverino, O. Maximum Scattered Linear Sets and Complete Caps in Galois Spaces. Combinatorica 2018, 38, 255–278. [Google Scholar] [CrossRef]
  20. Bartoli, D.; Csajbók, B.; Montanucci, M. On a conjecture about maximum scattered subspaces of Fq6 × Fq6. Linear Algebra Appl. 2021, 631, 111–135. [Google Scholar] [CrossRef]
  21. Napp, D.; Pinto, R.; Santana, F.; Vela, C. On the construction of MRD convolutional codes. Linear Multilinear Algebra 2024, 72, 2653–2673. [Google Scholar] [CrossRef]
  22. Shi, M.; Krotov, D.S.; Özbudak, F. Constructing MRD codes by switching. J. Comb. Des. 2024, 32, 219–237. [Google Scholar] [CrossRef]
  23. Chen, H. New Explicit Good Linear Sum-Rank-Metric Codes. IEEE Trans. Inf. Theory 2023, 69, 6303–6313. [Google Scholar] [CrossRef]
  24. Martínez-Peñas, U. New constructions of MSRD codes. Comput. Appl. Math. 2024, 43, 195. [Google Scholar] [CrossRef]
  25. Borello, M.; Zullo, F. Geometric dual and sum-rank minimal codes. J. Comb. Des. 2024, 32, 238–273. [Google Scholar] [CrossRef]
  26. Liu, X.; Zhang, J.; Wang, G. Constructions and List Decoding of Sum-Rank Metric Codes Based on Orthogonal Spaces over Finite Fields. arXiv 2025, arXiv:2507.16377. [Google Scholar] [CrossRef]
  27. Chen, J.; Xiong, J.; Wang, Y.; Xin, Q.; Zhou, H. Implementation of an AI-based MRD Evaluation and Prediction Model for Multiple Myeloma. Front. Comput. Intell. Syst. 2024, 6, 127–131. [Google Scholar] [CrossRef]
  28. Clerc, M.; Kennedy, J. The particle swarm—Explosion, stability, and convergence in a multidimensional complex space. IEEE Trans. Evol. Comput. 2002, 6, 58–73. [Google Scholar] [CrossRef]
  29. Trelea, I.C. The particle swarm optimization algorithm: Convergence analysis and parameter selection. Inf. Process. Lett. 2003, 85, 317–325. [Google Scholar] [CrossRef]
  30. Shi, Y.; Eberhart, R.C. Parameter selection in particle swarm optimization. In Evolutionary Programming VII; Springer: Berlin/Heidelberg, Germany, 1998; pp. 591–600. [Google Scholar] [CrossRef]
  31. Dehghani, B. PSO-Guided Construction of MRD Codes in Rank Metric, 2025. GitHub Repository Containing Implementation and Documentation. Available online: https://github.com/behnamde/pso_mrd (accessed on 7 April 2025).
  32. Hostetter, M. Galois: A Performant NumPy Extension for Galois Fields, 2020. GitHub Repository Containing Implementation and Documentation. Available online: https://github.com/mhostetter/galois (accessed on 1 April 2025).
Table 1. Comparison of MRD code construction approaches.
Table 1. Comparison of MRD code construction approaches.
Approach TypeKey ExamplesStrengthsLimitationsApplicability to Unexplored Regimes
Algebraic constructionsGabidulin [2]; twisted Gabidulin [5]; generalized twisted Gabidulin [6]; and geometric/scattered subspace [7,19,20]Exact MRD guarantee when applicable; solid theoryLimited to specific ( m , n , k , q ) ; beyond known families can be intractableLow: restricted by proven existence results
Other metaheuristicsGenetic algorithms [10,11]Flexible search in discrete spaces; can add constraintsMay need heavy tuning; convergence speed variesMedium: adaptable yet can struggle in high dimensional rank-metric spaces
Learning-based/AI methodsNeural code design [12]; inverse problem ML [14]Learns patterns from data; can generalizeNeeds training data; no exact MRD guarantees in generalMedium: depends on data quality and diversity
Proposed PSO-guided approachThis workNo need for closed-form structure; rank-aware constraints; adaptive exploration and exploitation; and seeding from known MRD codesNo formal global optimality proof; fitness evaluation costHigh: can target regimes without known algebraic constructions
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.

Share and Cite

MDPI and ACS Style

Dehghani, B.; Sakhaie, A. PSO-Guided Construction of MRD Codes for Rank Metrics. Mathematics 2025, 13, 2756. https://doi.org/10.3390/math13172756

AMA Style

Dehghani B, Sakhaie A. PSO-Guided Construction of MRD Codes for Rank Metrics. Mathematics. 2025; 13(17):2756. https://doi.org/10.3390/math13172756

Chicago/Turabian Style

Dehghani, Behnam, and Amineh Sakhaie. 2025. "PSO-Guided Construction of MRD Codes for Rank Metrics" Mathematics 13, no. 17: 2756. https://doi.org/10.3390/math13172756

APA Style

Dehghani, B., & Sakhaie, A. (2025). PSO-Guided Construction of MRD Codes for Rank Metrics. Mathematics, 13(17), 2756. https://doi.org/10.3390/math13172756

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

Article Metrics

Back to TopTop