Speeding up large problems
AnsweredHi everyone,
New to this community. Sorry if I'm using some (all) the terms in the wrong way, but I'm a layman.
I'm using Gurobi in PLEXOS software, to optimize power systems. Gurobi solver version I'm using is 11.0.2 - it's hardcoded in PLEXOS and can't be changed independently. In essence, I'm running an LP optimization, but the problem itself is very large. I'm looking for a way to speed it up as much as possible. Right now, the time necessary for the model to be solved is around 12h (hardware is adequate, R9950X, 256GB ram).
I've been checking the guides, but can't seem to find a way to do it. The objective function is in the range of 1e11, but the coefficient statistics shows a very large range for the objective:
Coefficient statistics:
Matrix Range: [-2.000000e+005] - [1.136000e+004] [1.000000e-006] - [2.000000e+005]
Objective Range: [-2.423562e+008] - [7.323547e+010] [1.182880e-003] - [7.323547e+010]
Bounds Range: [-8.170000e+003] - [5.830000e+008] [1.000008e-006] - [5.830000e+008]
RHS Range: [-1.312755e+006] - [5.830000e+008] [2.024018e-003] - [5.830000e+008]
I've read that I could add objective tolerance to remove any objective function below a certain value, but now I'm not sure how it works. As I've run multiple instances of the model with slight changes to it, the objective function value was always in the same range, so I thought that I might use the objective tolerance to remove the warning I get:
Warning: Model contains large objective coefficients
Consider reformulating model or setting NumericFocus parameter
to avoid numerical issues.
I also saw a suggestion to use objective scalar so that the objective value is in a more appropriate range. But when I set those two values as below:
Objective Scalar: 1e6
Objective tolerance: 1e9
The model went completely crazy, as the next run was done in only 48min, but the coefficient statistics showed this:
Coefficient statistics:
Matrix Range: [-3.495000e+004] - [1.136000e+004] [1.000439e-006] - [3.495000e+004]
Objective Range: [1.797693e+308] - [-1.797693e+308] [1.797693e+308] - [-1.797693e+308]
Bounds Range: [-8.170000e+003] - [5.830000e+008] [1.000008e-006] - [5.830000e+008]
RHS Range: [-1.312755e+006] - [5.830000e+008] [2.024018e-003] - [5.830000e+008]
I know I messed something up, can you point me in the right direction? Also, is intel a better fit for these large LP models? Reformulating the problem is not going to be easy, I have a huge amount of objects and constraints in the model, with a lot of these constraints being hard, but there are no infeasibilities.
If I'm being unclear, please let me know and I'll try and explain more - if there is anyone who can help with this issue.
-
Hi Danilo,
Thank you for reaching out to us. The warning you are seeing indicates that the model has numerical issues related to large coefficients. Such coefficients can negatively affect both solution time and solution quality. Our general recommendations for coefficients are as follows (also see What does Model contains large matrix coefficient range mean? ):
- The range of the matrix coefficients (the difference between the minimum and maximum coefficient values) should be within six orders of magnitude.
- For the objective function, the largest coefficient should not exceed 1e4 in magnitude. The same applies to the largest values in bounds and the right-hand side (RHS).
We also recommend that the objective value of good solutions lies between 1 and 1e4. From the coefficient statistics you provided, it appears that some of your coefficients fall outside these recommended ranges. We therefore suggest reducing the magnitude of the coefficients in your model. Please refer to this page on how it can be done Tolerances and User-Scaling
The parameters Objective Scalar and Objective are not part of Gurobi parameters. Does Plexos interface allow you to set Gurobi parameters directly? If so, you may find this overview of Gurobi parameters useful for managing numerical issues Solver Parameters to Manage Numerical Issues
If not, it would be helpful to consult the Plexos parameter reference to identify parameters that may assist with numerical issues.
Best regards
Nigora
0
Please sign in to leave a comment.
Comments
1 comment