[Python] Can I generate a pulp problem with a MPS file?

Discussão em 'Python' iniciado por Stack, Março 19, 2025.

  1. Stack

    Stack Membro Participativo

    I have a MPS file like this:

    * ENCODING=ISO-8859-1
    NAME test.lp
    ROWS
    N obj1
    L Constraint1
    G Constraint2
    COLUMNS
    x obj1 -3
    x Constraint1 1
    x Constraint2 2
    MARK0000 'MARKER' 'INTORG'
    y obj1 -2
    y Constraint1 2
    y Constraint2 -1
    MARK0001 'MARKER' 'INTEND'
    RHS
    rhs Constraint1 5
    rhs Constraint2 3
    BOUNDS
    UP bnd x 10
    LI bnd y 0
    ENDATA


    Can I generate a pulp problem with it? It can generate automatic or I have to read each line?

    I've search on the internet and I can export it like this:

    var1, prob1 = LpProblem.fromMPS("test.mps")


    I am thinking to generate the problem by take each variable in var1 and so on. Have any way to do it automatically? Thanks

    Continue reading...

Compartilhe esta Página