0
$\begingroup$

The problem I have made associated with OpenSolver and Gurobi takes about 50 minutes to solve, is this normal?

It has approximately 365 variables with upper and lower bands, the peculiarity is that one of those upper bands is dependent on the decision variable. Anyway, is it normal that it takes so long? Would it go faster with other software?

The result it gives is correct in spite of the time it takes.

enter image description here

$\endgroup$
10
  • 3
    $\begingroup$ Without more information, it's not possible to say anything. Can you at least post the log? $\endgroup$
    – fontanf
    Apr 21, 2022 at 9:55
  • $\begingroup$ Hi, sorry, what specifically is the Log? I specify as much as necessary. $\endgroup$
    – ADMGYP
    Apr 21, 2022 at 9:57
  • 1
    $\begingroup$ @ADMGYP, one possible way to accelerate the solving process is to use the evolutionary option in the solving sheet. It is very effective if you have faced with some non-linear terms in your problem. Otherwise, you need to explicitly describe the MP model in which the community folks can help you. 👍 $\endgroup$
    – A.Omidi
    Apr 21, 2022 at 10:16
  • $\begingroup$ The log is output from Gurobi indicating progress (number of nodes encountered so far, best bound so far, best incumbent so far, etc.). At the top of the log, it should also indicate problem dimensions. $\endgroup$
    – prubin
    Apr 21, 2022 at 15:25
  • 3
    $\begingroup$ Question for Gurobi log gurus: How can model have 365 columns, presolve removed 68 columns, and presolved has 555 columns? $\endgroup$ Apr 22, 2022 at 16:43

1 Answer 1

4
$\begingroup$

This is not a Gurobi issue - the log shows that the instance is solved within a second. I can only assume that the model-building process takes up a lot of time. OpenSolver apparently creates an LP file that is then read by Gurobi, so it does not use the API directly which is already suboptimal in terms of overall performance. There may also be some expensive Excel lookups being performed when constructing the model.

Please also consider that this model is very dense with about 240000 nonzeros for just 365 variables.

Using Excel to generate models is generally not recommended. You will have a much better experience when importing these Excel sheets using the Python pandas framework. Then, you can work on the data directly and use the Gurobi Python API directly without having to write a file first.

$\endgroup$
2
  • 1
    $\begingroup$ How can model have 365 columns, presolve removed 68 columns, and presolved has 555 columns? Is number of columns removed not a net figure, but a gross number removed, and some columns (possibly) added? $\endgroup$ Apr 24, 2022 at 11:29
  • 2
    $\begingroup$ The line "Presolve removed ... rows and ... columns" is actually an intermediate progress report and there will be multiple such lines if presolving takes more time. The final size of the problem may not always correspond to "origsize - removed" because potentially added auxiliary variables do not appear in the progress report. I agree, this can be confusing at times. $\endgroup$
    – mattmilten
    Apr 24, 2022 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.