kap-solver 0.3.0

k-assignment (k-partite matching) solvers and a rectangular linear assignment solver
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use kap::{Algo, MatrixView, Options, k_assignment};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let data = [1.0, f64::INFINITY, 9.0, 2.0, 8.0, 7.0];
    let costs = [MatrixView::from_row_major(&data, 3, 2)?];
    let opts = Options {
        threshold: Some(5.0),
        max_iter: 10,
        seed: 0,
        ..Options::default()
    };
    let result = k_assignment(&costs, Algo::Ils, &opts)?;
    println!("cliques = {:?}", result.cliques);
    println!("costs = {:?}", result.costs);
    println!("free = {:?}", result.free);
    Ok(())
}