Skip to main content

minimum_assignment

Function minimum_assignment 

Source
pub fn minimum_assignment<T>(cost: &[Vec<T>]) -> (i64, Vec<usize>)
where T: Copy + Into<i64>,
Expand description

Returns the minimum cost and a column assigned to each row of a square cost matrix.

Examples found in repository?
crates/library_checker/src/graph/assignment.rs (line 8)
5pub fn assignment(reader: impl Read, writer: impl Write) {
6    prepare_io!(reader, writer);
7    sc!(n, a: [[i32; n]; n]);
8    let (cost, assignment) = minimum_assignment(&a);
9    pp!(cost; @it assignment);
10}