Skip to main content

assign_with_cost_limit

Function assign_with_cost_limit 

Source
pub fn assign_with_cost_limit(
    rows: usize,
    cols: usize,
    costs: &[f64],
    cost_limit: f64,
) -> Assignment
Expand description

Minimum-cost assignment in which a row and a column may also stay unmatched, at a cost of cost_limit / 2 each.

This is the formulation of lap.lapjv(cost, extend_cost=True, cost_limit=...) that ByteTrack uses: a pair is only made when it is cheaper than leaving both sides unmatched, so no match costs cost_limit or more. costs is row-major, rows × cols. Entries that are not finite are forbidden pairs. With a cost_limit that is not positive and finite, nothing is matched.