Skip to main content

Algorithm for large model.

Answered

Comments

5 comments

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Anibal,

    There are a few things that come to mind.

    1. Your model is really big. It has over 100 mio nonzeros and still over 50 mio nonzeros after presolve. Thus, it is expected to take a lot of time. Although, the behavior you see seems extreme.
    2. You might want to experiment with the parameters Presolve=2, PreSparsify=1/2, and Aggregate=2. This might decrease the size of the presolved model further and hoperfully speed-up the optimization process.
    3. You could upgrade to the latest Gurobi version 11.
    4. If nothing helps, you could share the model. Note that uploading files in the Community Forum is not possible but we discuss an alternative in Posting to the Community Forum.

    Best regards, 
    Jaromił

    0
  • Anibal Baradei
    First Comment
    First Question

    Dear Jaromil,

    Thank you very much for your fast response.

    I will try to run again with those parameters and see if there is an improvement.

    Regarding the version 11, I have a student lic. requested last year with version 10 of gurobi, is there a way to ask for the latest one?

    And lastly, I would love to share the model since that would make things much easier, but unfortunately I'm writing a paper on it and until it is published I can't share it.

    Best regards,

    Anibal.

    0
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Anibal,

    Regarding the version 11, I have a student lic. requested last year with version 10 of gurobi, is there a way to ask for the latest one?

    As an academic, you can always get a new license for free. Please refer to Academic Program and Licenses.

    Best regards, 
    Jaromił

    0
  • Anibal Baradei
    First Comment
    First Question

    Dear Jaromil,

    I managed to upgrade Gurobi to v11.

    I ran 4 test on a smaller instance to check if the options had an effect and got the following results:

    opt={"Presolve":2,

         "PreSparsify":2,

       "Aggregate":2}
    DEFAULT:
    Presolve time: 12
    Barrier solve: 389 (377)
    Finished solve: 1537 (1148)

    -Presolved: 2236419 rows, 1633307 columns, 6431637 nonzeros
     Dense cols : 303
     AA' NZ     : 6.988e+06
     Factor NZ  : 5.993e+07 (roughly 2.0 GB of memory)
     Factor Ops : 1.401e+10 (less than 1 second per iteration)




    OPTIONS:
    Presolve time: 105
    Barrier solve: 431 (326)
    Finished solve: 1292 (861)

    -Presolved: 2236321 rows, 1633307 columns, 6431385 nonzeros
     Dense cols : 303
     AA' NZ     : 6.987e+06
     Factor NZ  : 6.011e+07 (roughly 2.0 GB of memory)
     Factor Ops : 1.416e+10 (less than 1 second per iteration)




    DEFAULT:
    Presolve time: 12
    Barrier solve: 378 (366)
    Finished solve: 1156 (778)

    -Presolved: 2236419 rows, 1633307 columns, 6431637 nonzeros
     Dense cols : 303
     AA' NZ     : 6.988e+06
     Factor NZ  : 5.993e+07 (roughly 2.0 GB of memory)
     Factor Ops : 1.401e+10 (less than 1 second per iteration)
     Threads    : 12




    OPTIONS:
    Presolve time: 101
    Barrier solve: 456 (355)
    Finished solve: 1385 (929)

    -Dense cols : 303
     AA' NZ     : 6.987e+06
     Factor NZ  : 6.011e+07 (roughly 2.0 GB of memory)
     Factor Ops : 1.416e+10 (less than 1 second per iteration)
     Threads    : 12

    I don't know if I'm missing something but my understanding is that the performance after the presolve is roughly the same (since the PC was being lightly used during runs for all cases so there are some fluctuations) but the presolve time is much higher with the options. 

    I guess I'm out of options to lower the solve time. I understand that also commercial softwares that solve energy systems take a considerable amount of time. Just to be sure, is there perhaps anything that might come to mind to try to lower the time?

     

     

    0
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Yes, it looks difficult. But at least the time per iteration decreased by a lot. Gurobi now only need roughly 1 second per iteration instead of 17 in your original post. You could also experiment with the AggFill parameter. It is hard to give a guidance for this parameter as it is very subtle, so you could just do some try-and-error.

    Just to be sure, is there perhaps anything that might come to mind to try to lower the time?

    Althought the numerics of your model look fine, maybe you can still slightly improve and gain something. We discuss numerics in detail in our Guidelines for Numerical Issues.

    Best regards, 
    Jaromił

     

    0

Please sign in to leave a comment.