Multi-Objective Adaptive Whale Optimization Algorithm (MO-AWAOA)
Project description
Multi-Objective Adaptive Whale Optimization Algorithm (MO-AWAOA)
This repository contains the implementation of the Multi-Objective Adaptive Whale Optimization Algorithm (MO-AWAOA), a nature-inspired optimization algorithm designed to solve both single-objective and multi-objective optimization problems. The algorithm integrates several enhancements, including quasi-oppositional learning, Lévy flight mutation, Gaussian Barebone mutation, and population restart mechanisms to improve convergence and diversity in the solution set.
🔧 Features
- Multi-Objective Support: Uses an external archive to store non-dominated solutions and applies crowding distance for diversity maintenance.
- Quasi-Oppositional Learning (QOBL): Enhances exploration during initialization by generating opposite solutions.
- Lévy Flight Mutation: Introduces long-range jumps to escape local optima.
- Gaussian Barebone Mutation: Exploits promising regions using a normal distribution centered around the best solution.
- Population Restart Strategy: Reinitializes part of the population when stagnation is detected.
📁 File Structure
base.py: Core classes (Solution,Problem,Population,Archive) representing individuals, objective functions, populations, and external archives.utils.py: Utility functions for dominance checks, crowding distance calculation, performance metrics (hypervolume, IGD), visualization, and checkpointing.algorithm.py: Main MO-AWAOA implementation with support for single and multi-objective optimization.
🧠 Classes and Functions
Base Classes
Solution: Encapsulates decision variables (x), objective values (f), rank, and crowding distance.Problem: Wraps the objective function and problem bounds.Population: Manages a collection ofSolutioninstances.Archive: Maintains a set of non-dominated solutions for multi-objective optimization.
Utilities
dominates: Determines whether one solution dominates another.crowding_distance_assignment: Assigns crowding distances to solutions for diversity preservation.hypervolume,igd: Performance indicators for evaluating multi-objective algorithms.plot_pareto_front: Visualizes the Pareto front in 2D or 3D.save_checkpoint,load_checkpoint: Supports saving and restoring algorithm states.
Algorithm
MOAWOA: Main optimizer class supporting both single and multi-objective problems._initialize_population_with_qobl: Initializes population using QOBL strategy._restart_population: Restarts part of the population to avoid stagnation.levy_flight,quasi_opposite_learning: Mutation strategies for exploration and exploitation.
🚀 Usage Example
import numpy as np
from moawaoa.algorithm import MOAWOA
# Define your objective function
def obj_func(x):
# Example: ZDT1 test function
g = 1 + 9 * np.sum(x[1:]) / len(x)
f1 = x[0]
f2 = g * (1 - np.sqrt(f1 / g))
return [f1, f2]
# Set up the problem
bounds = (0, 1)
dim = 30
num_objs = 2
pop_size = 50
max_iter = 100
# Run the optimizer
optimizer = MOAWOA(obj_func, bounds, dim, num_objs, pop_size, max_iter, verbose=True)
pareto_front = optimizer.optimize()
# Plot results
from moawaoa.utils import plot_pareto_front
plot_pareto_front(pareto_front)
📈 Performance Metrics
- Hypervolume: Measures the volume of the objective space dominated by the approximation set.
- Inverted Generational Distance (IGD): Evaluates both convergence and diversity of the obtained solutions compared to a reference set.
📦 Dependencies
numpymatplotlibscikit-learn(for IGD computation)deap(for hypervolume calculation)
Install dependencies using:
pip install numpy matplotlib scikit-learn deap
📝 License
This project is licensed under the MIT License – see the LICENSE file for details.
📬 Contact
For questions, suggestions, or contributions, feel free to open an issue or contact us directly.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mo_awaoa-1.2.tar.gz.
File metadata
- Download URL: mo_awaoa-1.2.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b49aeb5afdd22f30cd355a23b871b80937a579d8a80741b1e3daf6166830fac7
|
|
| MD5 |
8d0875a23eba1c94b907d444ee2925ff
|
|
| BLAKE2b-256 |
a02ff9d14db8d71fc33319cd94f0a6631b1ae5b7edc89f9d1ca94fc0f388f67a
|
File details
Details for the file mo_awaoa-1.2-py3-none-any.whl.
File metadata
- Download URL: mo_awaoa-1.2-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74e29fc6382b6dea7c1b6567e9e5c3e04cea1293066092e90407f2ea3828678d
|
|
| MD5 |
8e79b2385a2f01b8aa722546196ddd16
|
|
| BLAKE2b-256 |
f3d69d82b80b51ad9e4722f18819372fa9aa9d7348216125acab7549f20f0ff6
|