Skip to main content

Creating model takes too much time

Ongoing

Comments

2 comments

  • Official comment
    Simranjit Kaur
    Gurobi Staff 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 why not try our AI Gurobot?.
  • Sonja Mars
    Gurobi Staff Gurobi Staff

    Hi,

    These are many for loops that you have and a lot of conditions. Unfortunately, your code is not self-contained so I could not run it to do some tests. However, you should some small improvement by changing this 

    for s in S:
    for s_ in S_:
    for t in T:
    if s_ == s + 1:

    into this

    for s in S:
    for s_ in S_:
    if s_ == s + 1:
    for t in T:

    Additionally, the conditions for the quicksum seem to be quite complicated. Are you sure you have the best data structures for what you want to do? Is there any chance you can come up with a model that does not have a variable with 7 indices? How many x variables do you have? This seems to be something about arcs? So is this a dense network, do all arcs between two nodes exist? Can you represent this in a sparse way? 

    Best,

      Sonja

    0

Post is closed for comments.