Skip to main content

how to stay at the presolved state?

Answered

Comments

4 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than two years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support.
  • Michel Soares
    • Gurobi-versary
    • Thought Leader

    Hi,

    You can get the presolved model this way:

    reduced_model = model.presolve()
    reduced_model.write("reduced_model.lp")

    You may be able to directly modify the reduced_model directly as you wish, I have never tried. If it does not work, you can always read back this LP file from the reduced model.

    0
  • liu heng
    • Gurobi-versary
    • Conversationalist
    • Investigator

    Thank you Michel, but if call reduced_model=model.presolve(), the solution of 'reduced_model' cannot be mapped back to the solution of 'model'

    0
  • Riley Clement
    • Gurobi Staff

    Hi Liu Heng,

    I can confirm it is not possible for users to map between the original model and presolved model.  The relationship between these models is not as simple and straightforward as users often expect.  You may notice that variables and constraints in the presolved model may have the same names as variables and constraints in the original model however it is not safe to assume these are the same variables and constraints.  Apologies that this is not the answer you were hoping for.

    - Riley

    0

Post is closed for comments.