Skip to content

Feature: Add MLFA-GD (Firefly algorithm with multiple learning ability based on gender difference )#245

Closed
karakasarda wants to merge 3 commits into
thieu1995:masterfrom
karakasarda:feature/MLFA-GD
Closed

Feature: Add MLFA-GD (Firefly algorithm with multiple learning ability based on gender difference )#245
karakasarda wants to merge 3 commits into
thieu1995:masterfrom
karakasarda:feature/MLFA-GD

Conversation

@karakasarda

@karakasarda karakasarda commented Dec 30, 2025

Copy link
Copy Markdown

Description

This PR implements the Firefly algorithm with multiple learning ability based on gender difference(MLFA-GD), a new swarm-based optimization algorithm proposed in Scientific Reports (2025).

Changes included:

  • Added mealpy/swarm_based/MLFA_GD.py: The core implementation of the MLFA-GD algorithm.
  • Added tests/swarm_based/test_MLFA_GD.py: Unit tests to verify the algorithm's correctness and hyperparameter initialization.
  • Updated mealpy/swarm_based/init.py: Exposed the new class.
  • Updated README.md: Added MLFA-GD to the algorithm classification table.

The implementation follows the official paper's methodology, integrating the Firefly algorithm with multiple learning ability based on gender difference for improved optimization performance.

Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

Additional Information

  • Paper Reference: Firefly algorithm with multiple learning ability based on gender difference(MLFA-GD) support for solving global optimization problems (Scientific Reports, 2025).
  • Testing: The algorithm has been tested on standard benchmark functions (e.g., Sphere) and verified to converge correctly.

karakasarda and others added 3 commits December 30, 2025 20:20
Removed the creator comment from the MLFA_GD.py file.
Removed unnecessary comment about creation.
@karakasarda karakasarda changed the title Feature: Add MLFA-GD (Modified Lightning Firefly Algorithm with Gradient Descent) Feature: Add MLFA-GD (Firefly algorithm with multiple learning ability based on gender difference ) Jan 6, 2026

@anh9895 anh9895 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the comments.

@@ -0,0 +1,241 @@
#!/usr/bin/env python

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please copy the header from other files. And then update with your information. People will make assumption that I implement this code if there is no information of the coder.


class MLFA_GD(Optimizer):
"""
MLFA-GD: Moderate Firefly Algorithm with Gender Difference (or Firefly Algorithm with Multiple Learning Ability based on Gender Difference)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This algorithm is a variant of Firefly Algorithm. Therefore, you need to put it inside the file swarm_based/FFA.py. Just copy this class and put it under the OriginalFFA class.

1. https://doi.org/10.1038/s41598-025-09523-9
Notes:
Implementation based on the local PDF at D:\\Projects\\mealpy_v2\\MLFA-GD.pdf

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this local note. Use real DOI link.

@thieu1995 thieu1995 closed this Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants