good_lp 1.15.1

Mixed Integer Linear Programming for Rust, with an user-friendly API. This crate allows modeling LP problems, and lets you solve them with various solvers.
Documentation
1
2
3
4
5
6
7
use crate::{Variable, constraint::ConstraintReference};

/// A trait for solvers that support cardinality constraints
pub trait CardinalityConstraintSolver {
    /// Add cardinality constraint. Constrains the number of non-zero variables from `vars` to at most `rhs`.
    fn add_cardinality_constraint(&mut self, vars: &[Variable], rhs: usize) -> ConstraintReference;
}