algos/math/
integer_linear.rs

1use std::error::Error;
2
3pub mod benders;
4pub mod branch_and_bound;
5pub mod branch_and_cut;
6pub mod branch_and_price;
7pub mod branch_and_reduce;
8pub mod column_generation;
9pub mod dantzig_wolfe;
10pub mod gomory;
11pub mod lift_and_project;
12pub mod mixed_integer_rounding;
13
14#[derive(Debug, Clone)]
15pub struct IntegerLinearProgram {
16    pub objective: Vec<f64>,
17    pub constraints: Vec<Vec<f64>>,
18    pub bounds: Vec<f64>,
19    pub integer_vars: Vec<usize>,
20}
21
22#[derive(Debug, Clone)]
23pub struct ILPSolution {
24    pub values: Vec<f64>,
25    pub objective_value: f64,
26    pub status: ILPStatus,
27}
28
29#[derive(Debug, Clone, PartialEq)]
30pub enum ILPStatus {
31    Optimal,
32    Infeasible,
33    Unbounded,
34    MaxIterationsReached,
35}
36
37pub trait ILPSolver {
38    fn solve(&self, problem: &IntegerLinearProgram) -> Result<ILPSolution, Box<dyn Error>>;
39}
40
41pub use benders::BendersDecomposition;
42pub use branch_and_bound::BranchAndBoundSolver;
43pub use branch_and_cut::BranchAndCutSolver;
44pub use branch_and_price::BranchAndPriceSolver;
45pub use branch_and_reduce::BranchAndReduceSolver;
46pub use column_generation::ColumnGenerationSolver;
47pub use dantzig_wolfe::DantzigWolfeDecomposition;
48pub use gomory::GomoryCuttingPlanes;
49pub use lift_and_project::LiftAndProjectCuts;
50pub use mixed_integer_rounding::MixedIntegerRoundingCuts;