A Firefly Algorithm for Mixed-Variable Optimization Based on Hybrid Distance Modeling
Authors: Ousmane Tom Bechir, Adán José-García, Zaineb Chelly Garcia, Vincent Sobanski, Clarisse Dhaenens
Organizations: Univ. Lille, CNRS, Inria, Centrale Lille, UMR 9189 CRIStAL, F-59000 Lille, France · Univ. Lille, Inserm, CHU Lille, U1286 – INFINITE, Lille, France · Institut Universitaire de France (IUF), Paris, France
Several real-world optimization problems involve mixed-variable search spaces, where continuous, ordinal, and categorical decision variables coexist. However, most population-based metaheuristic algorithms are designed for either continuous or discrete optimization problems and do not naturally handle heterogeneous variable types. In this paper, we propose an adaptation of the Firefly Algorithm for mixed-variable optimization problems (FAmv). The proposed method relies on a modified distance-based attractiveness mechanism that integrates continuous and discrete components within a unified formulation. This mixed-distance approach enables a more appropriate modeling of heterogeneous search spaces while maintaining a balance between exploration and exploitation. The proposed method is evaluated on the CEC2013 mixed-variable benchmark, which includes unimodal, multimodal, and composition functions. The results show that FAmv achieves competitive, and often superior, performance compared with state-of-the-art mixed-variable optimization algorithms. In addition, experiments on engineering design problems further highlight the robustness and practical applicability of the proposed approach. These results indicate that incorporating appropriate distance formulations into the Firefly Algorithm provides an effective strategy for solving complex mixed-variable optimization problems.
Figures & tables
Category
Function ID
Function Name
Continuous
Separable
Symmetric
Optimum
Unimodal
F1
Sphere Function
✔
✔
✔
-1400
F2
Rotated High Conditioned Elliptic Function
✔
✕
✔
-1300
F3
Rotated Bent Cigar Function
✔
✕
✕
-1200
F4
Rotated Discus Function
✔
✕
✕
-1100
F5
Different Powers Function
✔
✔
✔
-1000
Multimodal
F6
Rotated Rosenbrocks Function
✔
✕
✕
-900
Table 1: The 28 benchmark functions from CEC 2013 and their main characteristics. The presence or absence of a property is indicated by ✔or ✕, respectively. Continuous denotes functions defined over continuous domains; separable indicates that the objective can be decomposed into independent contributions per variable; symmetric refers to invariance under permutation or sign changes of variables.
Variable
Description
Domain
ds
Shell thickness (discrete variable)
multiple of 0.0625
dh
Head thickness (discrete variable)
multiple of 0.0625
r
Inner radius of the pressure vessel
10≤r≤200
L
Length of the cylindrical section
10≤L≤200
Constraints
g1(x)
−ds+0.0193r≤0
Table 2: Mathematical formulation of the Pressure Vessel design problem.
Variable
Description
Domain
x1
Weld thickness
continuous
x2
Weld length
continuous
x3
Beam height
continuous
x4
Beam thickness
continuous
Constraints
g1(x)
τ(x)−τmax≤0
Table 3: Mathematical formulation of the Welded Beam design problem.
Variable
Description
Domain
d
Wire diameter
continuous, d≥0.2
D
Mean coil diameter
continuous, D≤3.0
N
Number of active coils
discrete
Constraints
g1(x)
πd38CfPmaxD−S≤0
g2(x)
δmax+1.05(N+2)d−Lfree≤0
Table 4: Mathematical formulation of the Coil Spring design (CSD) problem.
Figure 1: Overall performance of MVO-based methods on CEC benchmark functions: baseline algorithms (left) and FA-based variants (right). The x-axis shows the number of results statistically similar to the best, and the y-axis shows the number of best results. Algorithms in the top-right achieve the best performance. See Tables 5 and 7 for details.
Function
Statistic
PSOmv
DEmv
GA
FA
FAmv H
FAmv H∗
FAmv G
FAmv G∗
Unimodal functions (F1–F5)
F1
Mean
1.19e+04
5.76e+02
1.93e+03
1.71e+05
4.81e+02
4.47e+02 *
5.16e+02
4.79e+02
STD
3.03e+03
2.13e+02
4.95e+02
1.92e+04
5.60e+01
8.43e+01 *
5.69e+01
7.92e+01
F2
Mean
3.87e+08
3.31e+08
1.25e+08
7.10e+09
2.43e+07 *
2.92e+07
3.08e+07
3.46e+07
STD
1.26e+08
4.92e+07
3.04e+07
1.98e+09
5.69e+06 *
8.08e+06
8.63e+06
8.99e+06
F3
Mean
1.49e+11
4.77e+09
2.39e+10
1.60e+21
1.63e+09 *
2.07e+09
2.25e+09
4.14e+09
Table 5: Performance of the mixed-variable optimization methods evaluated on the 28 CEC benchmark functions. Performance is evaluated in terms of the absolute error (AE). The best value (lowest average) is indicated with (*), whereas statistically similar results are highlighted in bold .
Figure 2: Performance in terms of the absolute error (the lower the better) scored by the seven mixed-variable optimization methods on the CEC benchmark for the unimodal functions .
Figure 3: Performance in terms of the absolute error (the lower the better) scored by the seven mixed-variable optimization methods on the CEC benchmark for the multimodal functions .
Figure 4: Performance in terms of the absolute error (the lower the better) scored by the seven MVO methods on composite functions in the CEC benchmark.
Function
PSOmv
DEmv
GA
FAmv H
FAmv G
BEAM
0.85 ± 0.30
0.51 ± 0.18
1.11 ± 0.64
0.49 * ± 0.18
0.51 ± 0.27
CSD
1.13 ± 0.05
1.08 * ± 0.03
1.74 ± 0.81
1.18 ± 0.05
1.18 ± 0.06
Vessel
6363.68 ± 1978.77
4331.97 ± 2040.48
2724.67 ± 2055.74
4283.55 ± 2164.54
1903.08 * ± 2090.71
Table 6: Performance of MVO methods on the three engineering design problems, measured by the absolute error (AE). The best value (lowest) is indicated with (*), and statistically similar results are highlighted in bold .
Figure 5: Performance of MVO methods on the three engineering design problems (BEAM, CSD, and Vessel), measured by absolute error (top) and convergence curves (bottom). Lower values indicate better performance.
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 6: The influence of the control parameter k on the probability function pα presented in Section 3.2
Figure 7: Convergence curves of the MVO methods on unimodal functions in the CEC benchmark.
Figure 8: Convergence curves of the MVO methods on multimodal functions in the CEC benchmark.
Figure 9: Convergence curves of the MVO methods on composite functions in the CEC benchmark.
Func.
Statistic
FA
FAmv G
FAmv Gα
FAmv Gαγ
FAmv Gγ
FAmv GD
FAmv H
FAmv Hα
FAmv Hαγ
FAmv Hγ
F1
Mean
1.71e+05
5.16e+02
4.35e+02 *
4.79e+02
5.53e+02
6.42e+02
4.81e+02
4.47e+02
4.90e+02
5.31e+02
STD
1.92e+04
5.69e+01
7.08e+01 *
7.92e+01
6.57e+01
7.28e+01
5.60e+01
8.43e+01
7.80e+01
6.28e+01
F2
Mean
7.10e+09
3.08e+07
3.77e+07
3.46e+07
3.09e+07
4.89e+07
2.43e+07
2.92e+07
2.55e+07
2.30e+07 *
STD
1.98e+09
8.63e+06
1.25e+07
8.99e+06
6.51e+06
1.86e+07
5.69e+06
8.08e+06
7.25e+06
4.64e+06 *
F3
Mean
1.60e+21
2.25e+09
5.10e+09
4.14e+09
2.84e+09
3.68e+09
1.63e+09 *
2.07e+09
2.09e+09
2.12e+09
STD
3.08e+21
1.23e+09
5.22e+09
4.55e+09
1.07e+09
1.66e+09
5.47e+08 *
8.97e+08
9.82e+08
1.00e+09
Appendix
Table 7: Performance of the FA-based variants evaluated on the 28 CEC benchmark functions. Performance is evaluated in terms of the absolute error (AE). The best value (lowest average) is indicated with (*), whereas statistically similar results are highlighted in bold .
Figure 10: Performance scored by the FA-based variants on the CEC benchmark for the unimodal functions .
Figure 11: Performance scored by the FA-based variants on the CEC benchmark for the multimodal functions .
Figure 12: Performance scored by the FA-based variants on the CEC benchmark for the composition functions .
Figure 13: Convergence curves of the FA-based variants on unimodal functions in the CEC benchmark.
Figure 14: Convergence curves of the FA-based variants on multimodal functions in the CEC benchmark.
Figure 15: Convergence curves of the FA-based variants on composition functions in the CEC benchmark.
Key Laboratory of Hunan Province for Internet of Things and Information Security, Xiangtan University, Xiangtan 411105, China, and also with the Key Laboratory of Intelligent Computing and Information Processing, Ministry of Education, Xiangtan University, Xiangtan 411105, China
Faculty of Physics and Applied Computer Science, AGH University of Krakow, al. A. Mickiewicza 30, 30-059 Cracow, Poland. · Systems Research Institute, Polish Academy of Sciences, ul. Newelska 6, 01-447 Warsaw, Poland. · AGH Doctoral School, AGH University of Krakow, al. A. Mickiewicza 30, 30-059 Cracow, Poland. +2