Skip to main content

Different methods to solve a model

Answered

Comments

3 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three 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.
  • Jonasz Staszek
    • Community Moderator
    • Gurobi-versary
    • Thought Leader
    • First Question

    Hi Jose,

    as far as I know, each gp.Model() is a separate object in Python, and hence, it will contain all the constraints and variables which were added to it.

    If your models are not too big, you could try generating a copy of the model and then use the two solution methods on the two model instances separately. If this is not the case, you'll have to remove the variables and constraints you don't need "manually".

    Hope this helps.

    Best regards
    Jonasz

    1
  • Jose Vindel
    • Gurobi-versary
    • Thought Leader
    • Investigator

    Hi Jonasz,

    Thanks so much for your answer

    It is actually the opposite, I've noticed that when building the linear constraints it takes quite a while (+1000 linear equations) so I wanted to have the model already built and then just run it through the different methods. To save some time when creating the object. It is clear that what I want to do will have to be implemented by adding and removing manually. I'll try it, and it might be the case that the time is cut down (hopefully).

    Best regards

    Jose

    0

Post is closed for comments.