lp-solvers icon indicating copy to clipboard operation
lp-solvers copied to clipboard

Input linear program using matrix format

Open luli-git opened this issue 3 years ago • 4 comments

Hi,

I'm trying to find some solver to solver some large optimization problems. I have my constraints formatted as Ax=b. However, in the example you provided, variables and constraints are added one by one like below:

variables: vec![
            Variable {
                name: "x".to_string(),
                is_integer: true,
                lower_bound: -10.,
                upper_bound: -1.,
            },
            Variable {
                name: "y".to_string(),
                is_integer: true,
                lower_bound: 4.,
                upper_bound: 7.,
            },
        ],

which does not seem very efficient for problems with thousands of variables. Do you know how to format an optimization problem using sparse matrices and vectors without having to add the coefficients one by one?

Thank you for your help.

luli-git avatar May 22 '21 18:05 luli-git