An enhanced implementation of the Whale Optimization Algorithm (WOA), a nature-inspired metaheuristic optimization technique based on the bubble-net hunting strategy of humpback whales. This project introduces several improvements to the standard WOA to achieve faster convergence, better exploration, and improved solution quality on optimization problems.
The Whale Optimization Algorithm (WOA) is a population-based optimization algorithm proposed by Mirjalili and Lewis (2016). While the original WOA performs well on many optimization tasks, it may suffer from:
- Premature convergence
- Local optima stagnation
- Slow convergence on complex search spaces
This project implements an Enhanced Whale Optimization Algorithm (EWOA) with modifications designed to improve exploration and exploitation balance.
- ✅ Enhanced exploration strategy
- ✅ Improved exploitation mechanism
- ✅ Faster convergence speed
- ✅ Reduced risk of local optima trapping
- ✅ Benchmark function evaluation
- ✅ Visualization of convergence curves
- ✅ Modular and extensible code structure
-
Initialize whale population randomly.
-
Evaluate fitness of each whale.
-
Identify the current best solution.
-
Update whale positions using:
- Encircling prey mechanism
- Bubble-net attacking strategy
- Random search exploration
-
Apply enhancement strategies.
-
Recalculate fitness values.
-
Update global best solution.
-
Repeat until termination criteria are met.
git clone https://github.com/yourusername/Enhanced-Whale-Optimization-Algorithm.git
cd Enhanced-Whale-Optimization-Algorithmpython -m venv venvWindows:
venv\Scripts\activateLinux/Mac:
source venv/bin/activatepip install -r requirements.txtRun the optimization algorithm:
python main.pyExample:
from src.ewoa import EnhancedWOA
optimizer = EnhancedWOA(
population_size=30,
max_iterations=500,
dimensions=30
)
best_solution, best_fitness = optimizer.optimize()
print(best_solution)
print(best_fitness)The Enhanced WOA was evaluated on standard benchmark optimization functions.
| Function | WOA | Enhanced WOA |
|---|---|---|
| Sphere | Better | Best |
| Rastrigin | Better | Best |
| Rosenbrock | Better | Best |
| Ackley | Better | Best |
Add your convergence plot here:
This implementation introduces:
- Adaptive parameter control
- Dynamic exploration-exploitation balancing
- Diversity preservation mechanism
- Improved position update strategy
- Random perturbation for escaping local optima
EWOA can be applied to:
- Machine Learning Hyperparameter Optimization
- Feature Selection
- Engineering Design Optimization
- Resource Allocation
- Scheduling Problems
- Energy Management Systems
- Image Processing Tasks
- Python
- NumPy
- Matplotlib
- Pandas
- Scikit-Learn
-
Mirjalili, S., & Lewis, A. (2016). The Whale Optimization Algorithm. Advances in Engineering Software, 95, 51–67.
-
Various recent enhancements and hybrid metaheuristic optimization studies.
Contributions are welcome.
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to your branch
- Open a Pull Request
This project is licensed under the MIT License.
Abdul Mujeeb
B.Tech Student | AI & Machine Learning Enthusiast
GitHub: https://github.com/yourusername