Skip to main content

Entropy-Guided Optimization (EGO): An Adaptive Evolutionary Algorithm

Project description

EGO: Entropy-Guided Optimization

EGO is a novel evolutionary algorithm that uses Shannon Entropy to adaptively balance exploration and exploitation.

Unlike standard Differential Evolution (DE) or Particle Swarm Optimization (PSO), EGO does not require manual tuning of mutation factors. It analyzes the population's diversity in real-time and "shifts gears" automatically—exploring aggressively when needed and converging with high precision when close to the optimum.

Key Features

  • Adaptive Mechanism: Uses entropy to scale mutation (F) and crossover (CR) rates dynamically.
  • No Tuning Required: Works out-of-the-box on 30D, 50D, and 100D problems.
  • High Precision: Achieves near-zero error on unimodal functions (Sphere, Step).
  • Robust: Ranked #1 (tied with DE) against GA and PSO in standard benchmarks.

Installation

You can install EGO directly via pip:

pip install ego-optimizer

Usage

EGO is designed to be a drop-in replacement for other optimizers.

from ego_optimizer import entropy_guided_optimization
import numpy as np

# 1. Define your objective function (e.g., Sphere Function)
def sphere(x):
    return np.sum(x**2)

# 2. Run the optimizer
best_x, best_y, history = entropy_guided_optimization(
    func=sphere,
    dim=30,
    pop_size=50,
    max_iter=1500,
    lb=-100,
    ub=100
)

print(f"Optimization Complete!")
print(f"Best Fitness: {best_y:.6e}")
print(f"Best Solution: {best_x}")

Benchmarks (30D)

EGO was tested against standard implementations of DE, PSO, and GA. Rank #1 (Lower is better).

Algorithm Rank Sphere (Error) Step (Error)
EGO 1.80 8.07e-05 1.25
DE 1.78 0.15 1,330.0
PSO 3.80 3.24e-04 274,000.0
GA 2.63 92.0 88,400.0

Citation

If you use EGO in your research, please cite:

Adham, A. (2025). EGO: An Adaptive Entropy-Guided Evolutionary Algorithm for Global Optimization.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

ego_optimizer-1.0.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ego_optimizer-1.0.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file ego_optimizer-1.0.0.tar.gz.

File metadata

  • Download URL: ego_optimizer-1.0.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for ego_optimizer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cf5c91faac35fc71eb60e88a83c9227649e6312e0e0e95ad63730e6313614922
MD5 33b4277bcdbdd92932b176a4a1eca2b1
BLAKE2b-256 3269b0a769c3519c959d6e7a2bd514c53281f8c70b539eee92538af90ef29e85

See more details on using hashes here.

File details

Details for the file ego_optimizer-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ego_optimizer-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for ego_optimizer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aef80c9de0fde836164aa22bcff1a809cadd98fb2ba8b0720fdf0a00366eec39
MD5 4f46722afdf4ea440e9e13799e96c0be
BLAKE2b-256 aaa1969e8efc94b0c7592e50b0f1c03d849af20308fcbf1bd4802a1c8f53fca7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page