Skip to main content

Does modification on presolved model affect original model?

Answered

Comments

3 comments

  • Elisabeth Rodríguez Heck
    • Gurobi Staff

    Hi Liu,

    If you optimize p, this will not affect the original model object m. 

    Concerning the modification of variable bounds on p, this also does not affect the original model object m. However, please note that the variables in the presolved model p do in general not match the variables in the original model m, so a modification of the bounds in p might not directly translate to a modification of the bounds in m. 

    The article How does presolve work? explains this in detail.

    Best regards,

    Elisabeth

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

    Thanks a lot! Can I just assume that when I call p = m.presolve(), then p and m are independent, modifications on either model will not affect the other?

    0
  • Elisabeth Rodríguez Heck
    • Gurobi Staff

    Yes, p and m are independent objects, so modifying one will not affect the other.

    Best,

    Elisabeth

    0

Please sign in to leave a comment.