Skip to main content

MvHeuristic

Trait MvHeuristic 

Source
pub trait MvHeuristic<S, V> {
    // Required method
    fn estimates(&mut self, state: &S, out: &mut Vec<V>);
}
Expand description

A multi-valued heuristic (MVH): for every state, a set of cost vectors that bound the remaining cost to a goal from below.

Wolff, Felner, Salzman, “Bridging Multi-Valued Heuristics and Dimensionality Reduction in Multi-Objective Search”, arXiv 2606.20644.

  • Admissible: for every path from state to a goal, some estimate weakly dominates its cost. In particular every goal has the zero vector among its estimates.
  • Consistent (monotone): every goal’s estimates are {0}, and for every edge (s, t) with cost c and every estimate h' of t, some estimate h of s has h <= c + h' component-wise (Mandow and Pérez de la Cruz 2010, Definition 5.7). The exact Pareto sets of the remaining cost are consistent in this sense.

Wolff et al. state consistency with the quantifiers the other way round (every h of s has some h' of t), which their own Table 1 and the exact Pareto sets do not satisfy. What namoa_star_dr_mvh needs is that every path to a goal carries a chain of estimates h_k <= c_k + h_(k+1) ending in the goal’s 0; either form provides one.

A single-valued Heuristic is the special case of one estimate per state; wrap it in SingleValued. Implemented for closures through mv_heuristic_fn and for &mut M.

§Examples

use multiobjective_search::{MvHeuristic, mv_heuristic_fn};

// Two trade-offs from state 0, the goal 1 is free.
let mut h = mv_heuristic_fn(|s: &u8, out: &mut Vec<[u32; 2]>| match s {
    0 => out.extend([[1, 5], [4, 2]]),
    _ => out.push([0, 0]),
});

let mut out = Vec::new();
h.estimates(&0, &mut out);
assert_eq!(out, [[1, 5], [4, 2]]);

Required Methods§

Source

fn estimates(&mut self, state: &S, out: &mut Vec<V>)

Appends the estimates of state to out.

out is empty on entry. Appending nothing marks state as a dead end from which no goal is reachable. The estimates need not be mutually non-dominated or sorted; the searches handle both.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<S, V, M: MvHeuristic<S, V> + ?Sized> MvHeuristic<S, V> for &mut M

Source§

fn estimates(&mut self, state: &S, out: &mut Vec<V>)

Implementors§

Source§

impl<S, V, F: FnMut(&S, &mut Vec<V>)> MvHeuristic<S, V> for MvHeuristicFn<F>

Source§

impl<S, V, H: Heuristic<S, V>> MvHeuristic<S, V> for SingleValued<H>

Source§

impl<S: Ord, C: Cost, const N: usize> MvHeuristic<S, [C; N]> for &MvhTable<S, C, N>

Source§

impl<S: Ord, C: Cost, const N: usize> MvHeuristic<S, [C; N]> for MvhTable<S, C, N>