Skip to content

Input linear program using matrix format #1

@luli-git

Description

@luli-git

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions