Skip to main content

Creating model takes too much time

Ongoing

Comments

1 comment

  • 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

Please sign in to leave a comment.