Skip to main content

How to create a tupledict of linear expressions?

Answered

Comments

4 comments

  • Matthias Miltenberger
    Gurobi Staff Gurobi Staff

    Hi Daniel,

    I cannot see an obvious flaw in your formulation, but I also don't know what you are trying to model.

    I strongly recommend writing out the LP file after constructing the model to check and verify that this actually corresponds to your mathematical formulation.

    Concerning the performance: You should inspect the presolving section when optimizing this model. Gurobi may reduce the model size on its own, so you should first check whether the performance is acceptable. Then, you can still try improving the formulation.

    Cheers,
    Matthias

    0
  • Daniel Martin Baquero Guerrero
    Gurobi-versary
    First Comment
    First Question

    Dear Matthias,

     

    I’m modelling a time assignment (scheduling) model. The variable x is indexed by the position, the day, and time of the start of the shift. X represent the amount of people of the position (c) that start their shift at time and day (t,d). This people would only be available in certain time windows. The A matrices are binary matrices with 1’s in time window (i,j) when shift (t,d) is available and 0 otherwise. As there are overlaps between shifts and time windows the total available workers for position (c), in time window (i,j) is disp[c,t,d]:

    sum(x[c,j,i]*A[j,i,d,t] for j in J for i in I)

    The model is right, when checking the LP file everything is working as expected. My concern was about performance as in competing solvers the time the model takes to converge is lower.

     

    Kind regards,

    Daniel M. Baquero

    0
  • Matthias Miltenberger
    Gurobi Staff Gurobi Staff

    Hi Daniel,

    It's good to hear that your formulation appears to be correct. How do you construct the model for other solvers to get a better performance? Maybe you could write out the MPS file and feed this into Gurobi to have a better performance comparison.

    Best regards,
    Matthias

    0
  • Daniel Martin Baquero Guerrero
    Gurobi-versary
    First Comment
    First Question

    Hi Matthias,

    I used the same MPS file in the other solvers to compare the performance. I'm already post a service request to compare the performance and other staff member is working with me.

    Thank you

    0

Please sign in to leave a comment.