optimization-multi-objective

Optimizationdeaprigorous codebase

Description

Multi-Objective Optimization: Custom Evolutionary Strategy Design

Research Question

Design a novel multi-objective evolutionary algorithm (MOEA) strategy that achieves better convergence, diversity, and spread on standard benchmark problems than classic approaches like NSGA-II, MOEA/D, and SPEA2.

Background

Multi-objective optimization aims to find a set of Pareto-optimal solutions that represent the best trade-offs among conflicting objectives. Evolutionary algorithms are the dominant approach, differing primarily in three components:

  • Parent selection: How to choose individuals for mating (e.g., tournament with crowding distance, reference-vector-based).
  • Variation: How to produce offspring via crossover and mutation operators.
  • Environmental selection (survival): How to prune the combined parent+offspring pool back to population size (e.g., non-dominated sorting + crowding, decomposition into subproblems, indicator-based selection).

Classic algorithms include:

  • NSGA-II (Deb et al., 2002): Non-dominated sorting + crowding distance for diversity.
  • MOEA/D (Zhang & Li, 2007): Decomposes the problem into scalar subproblems using weight vectors.
  • SPEA2 (Zitzler et al., 2001): Strength-based fitness with density estimation via k-nearest neighbors.

State-of-the-art methods include:

  • NSGA-III (Deb & Jain, 2014): Reference-point-based selection for many-objective problems.
  • RVEA (Cheng et al., 2016): Angle-penalized distance with adaptive reference vectors.
  • AGE-MOEA (Panichella, 2019): Adaptive geometry estimation for survival selection.

There is active research into strategies that combine ideas across these paradigms, adapt to problem geometry, or use novel diversity maintenance mechanisms.

Task

Implement a custom multi-objective evolutionary strategy by modifying the CustomMOEA class in deap/custom_moea.py. You should implement the select, vary, survive, and optionally on_generation methods. The algorithm must work for both 2-objective and 3-objective problems.

Interface

class CustomMOEA:
    def __init__(self, pop_size, n_obj, n_var, bounds, cx_eta=20.0, mut_eta=20.0, mut_prob=None):
        """Initialize the MOEA with problem parameters."""

    def select(self, population: list, k: int) -> list:
        """Select k parents from the population for mating.
        Returns: list of k selected individuals."""

    def vary(self, parents: list) -> list:
        """Apply crossover and mutation to produce offspring.
        Returns: list of offspring (fitness invalidated)."""

    def survive(self, population: list, offspring: list) -> list:
        """Environmental selection: choose pop_size individuals from combined pool.
        Returns: list of pop_size individuals for next generation."""

    def on_generation(self, gen: int, population: list):
        """Optional per-generation callback for adaptive strategies."""

Individual interface:

  • ind.fitness.values -> tuple of objective values (all minimized)
  • ind.fitness.dominates(other.fitness) -> bool
  • ind.fitness.valid -> bool (True if evaluated)

Available DEAP utilities:

  • tools.sortNondominated(pop, k) -> list of fronts
  • tools.selTournamentDCD(pop, k) -> tournament selection (needs crowding dist)
  • tools.selNSGA3(pop, k, ref_points) -> NSGA-III selection
  • tools.cxSimulatedBinaryBounded(ind1, ind2, eta, low, up) -> SBX crossover
  • tools.mutPolynomialBounded(ind, eta, low, up, indpb) -> polynomial mutation
  • tools.uniform_reference_points(nobj, p) -> generate reference points
  • compute_crowding_distance(individuals) -> sets .fitness.crowding_dist
  • get_nondominated(population) -> first non-dominated front

Evaluation

Evaluated on four benchmark problems (run with multiple seeds):

  • ZDT1 (2D objectives, convex front, 30 variables, 200 generations)
  • ZDT3 (2D objectives, disconnected front, 30 variables, 200 generations)
  • DTLZ2 (3D objectives, spherical front, 12 variables, 250 generations)
  • DTLZ1 (3D objectives, linear front with many local fronts, 7 variables, 400 generations)

Three metrics are reported:

  • Hypervolume (HV): Volume of objective space dominated by the Pareto front approximation. Higher is better.
  • Inverted Generational Distance (IGD): Average distance from true Pareto front points to nearest found solution. Lower is better.
  • Spread: Uniformity of the Pareto front approximation. Lower is better.

Code

custom_moea.py
EditableRead-only
1"""
2Multi-Objective Optimization — Custom Evolutionary Strategy Template
3
4This script runs a complete multi-objective evolutionary algorithm on standard
5benchmark problems (ZDT/DTLZ). The agent should implement the custom selection
6and variation strategy in the CustomMOEA class.
7
8Usage:
9 python deap/custom_moea.py --problem zdt1 --seed 42 --output-dir ./out
10"""
11
12import argparse
13import json
14import math
15import os

Results

ModelTypehv zdt1 igd zdt1 spread zdt1 hv zdt3 igd zdt3 spread zdt3 hv dtlz2 igd dtlz2 spread dtlz2 hv dtlz1 igd dtlz1 spread dtlz1
agemoeabaseline0.8630.0080.5831.3160.0080.7652.5720.0910.5190.9570.0252.158
moeadbaseline0.8630.0100.5071.3210.0100.9402.7370.0760.8460.9530.0344.408
nsga2baseline0.8680.0050.3431.3260.0060.5662.7410.0650.6530.9700.0270.904
nsga3baseline0.8690.0040.2871.3230.0060.6212.7900.0520.6210.9730.0200.648
rveabaseline0.8650.0060.4291.3160.0090.6032.7890.0550.3830.9630.0501.429
spea2baseline0.8680.0050.1491.3240.0050.4262.7810.0500.1060.9740.0180.138
anthropic/claude-opus-4.6vanilla0.8680.0050.3261.3240.0050.5332.7550.0540.2390.9710.0217.224
deepseek-reasonervanilla0.8690.0050.4121.3280.0050.5442.7880.0550.6260.9740.0200.591
google/gemini-3.1-pro-previewvanilla0.8690.0050.3481.3250.0060.7062.7900.0700.5410.9680.0200.201
openai/gpt-5.4-provanilla0.8680.0050.3901.3240.0050.4802.7820.0520.2660.9740.0180.224
qwen3.6-plus:freevanilla0.5600.3221.8340.7060.6471.6072.1550.5517.6760.6060.1747.678
anthropic/claude-opus-4.6agent0.8680.0050.3261.3240.0050.5332.7910.0520.5620.9720.0230.810
deepseek-reasoneragent0.8690.0050.4201.3270.0060.5262.2040.3051.4170.5780.2020.987
google/gemini-3.1-pro-previewagent0.0002.3591.8220.0002.2121.8181.1130.4721.6060.00041.8692.485
openai/gpt-5.4-proagent0.8690.0050.2901.3210.0060.4642.7940.0470.2370.9740.0180.205
qwen3.6-plus:freeagent0.8690.0050.3631.3270.0060.5872.7910.0500.4480.9740.0180.418

Agent Conversations