Skip to main content

Module multi_objective

Module multi_objective 

Source
Expand description

Multi-objective optimization via a dedicated study type.

MultiObjectiveStudy manages trials that return multiple objective values simultaneously. It supports arbitrary numbers of objectives with per-objective directions (minimize or maximize).

§Key concepts

In multi-objective optimization there is usually no single best solution. Instead, there is a Pareto front — the set of solutions where no objective can be improved without worsening another. Use pareto_front() to retrieve these non-dominated solutions after optimization.

A solution dominates another if it is at least as good in all objectives and strictly better in at least one. Solutions that are not dominated by any other are called Pareto-optimal.

§Samplers

By default a random sampler is used. For smarter search, pass a MultiObjectiveSampler such as Nsga2Sampler, Nsga3Sampler, or MoeadSampler via MultiObjectiveStudy::with_sampler.

§Examples

use optimizer::Direction;
use optimizer::multi_objective::MultiObjectiveStudy;
use optimizer::parameter::{FloatParam, Parameter};

let study = MultiObjectiveStudy::new(vec![Direction::Minimize, Direction::Minimize]);
let x = FloatParam::new(0.0, 1.0);

study
    .optimize(20, |trial: &mut optimizer::Trial| {
        let xv = x.suggest(trial)?;
        Ok::<_, optimizer::Error>(vec![xv, 1.0 - xv])
    })
    .unwrap();

let front = study.pareto_front();
assert!(!front.is_empty());

Structs§

MultiObjectiveStudy
A study for multi-objective optimization.
MultiObjectiveTrial
A completed trial with multiple objective values.

Traits§

MultiObjectiveSampler
Trait for samplers aware of multi-objective history.