Skip to main content

hypervolume_2d

Function hypervolume_2d 

Source
pub fn hypervolume_2d(
    front: &[(f64, f64)],
    reference: (f64, f64),
) -> OptimizeResult<f64>
Expand description

Compute the hypervolume dominated by a 2-D Pareto front.

The front need not be pre-sorted or pre-filtered; dominated points are handled automatically.

§Arguments

  • front — Pareto front as &[(f1, f2)]. All objectives minimised.
  • reference — Reference point (r1, r2). Every front point must satisfy f_i < r_i for all i for a positive contribution.

§Returns

The hypervolume (area) dominated by the front and bounded by reference. Returns 0.0 if the front is empty.

§Errors

Returns an error if reference dimensions do not match.

§Examples

use scirs2_optimize::multiobjective::hypervolume::hypervolume_2d;
let front = &[(0.0, 1.0), (0.5, 0.5), (1.0, 0.0)];
let hv = hypervolume_2d(front, (2.0, 2.0)).expect("valid input");
assert!((hv - 2.75).abs() < 1e-10);