Quadratic constraints contain large coefficients on linear part.
AnsweredHi,
I use matlab+yalmip+gurobi to solve a mixed integer nonlinear programming problem. The parameters I set are as follows:
options = sdpsettings('verbose',2,'solver','GUROBI', 'debug', 1, 'gurobi.NonConvex', 2,'gurobi.timelimit',l300,'gurobi.MIPGap', 10^(-4));
Then the results are as follows:
Set parameter Username
Set parameter TimeLimit to value 300
Set parameter CrossoverBasis to value 0
Set parameter NodefileDir to value ""
Set parameter NonConvex to value 2
Set parameter PreSOS2BigM to value 0
Set parameter TuneTrials to value 3
Academic license - for non-commercial use only - expires 2022-06-11
Gurobi Optimizer version 9.5.1 build v9.5.1rc2 (win64)
Thread count: 2 physical cores, 4 logical processors, using up to 4 threads
Optimize a model with 21417 rows, 7627 columns and 41884 nonzeros
Model fingerprint: 0x30b516c1
Model has 4110 quadratic constraints
Variable types: 3840 continuous, 3787 integer (3787 binary)
Coefficient statistics:
Matrix range [1e-05, 7e+04]
QMatrix range [8e-01, 1e+01]
QLMatrix range [1e+00, 1e+09]
Objective range [1e+00, 1e+00]
Bounds range [1e+00, 1e+00]
RHS range [1e-05, 1e+07]
QRHS range [1e+09, 1e+09]
Warning: Quadratic constraints contain large coefficients on linear part
Consider reformulating model or setting NumericFocus parameter
to avoid numerical issues.
Presolve removed 19956 rows and 6799 columns
Presolve time: 0.95s
Presolved: 3248 rows, 1100 columns, 8370 nonzeros
Presolved model has 47 quadratic constraint(s)
Presolved model has 486 bilinear constraint(s)
Variable types: 837 continuous, 263 integer (252 binary)
Root relaxation: objective -3.400900e+05, 472 iterations, 0.01 seconds (0.01 work units)
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
0 0 -318634.88 0 128 - -318634.88 - - 1s
0 0 -311917.48 0 125 - -311917.48 - - 1s
H 0 0 0.0000000 -311917.48 - - 1s
0 0 -311872.83 0 132 0.00000 -311872.83 - - 1s
0 0 -311834.12 0 135 0.00000 -311834.12 - - 1s
0 0 -311753.21 0 136 0.00000 -311753.21 - - 1s
0 0 -307499.21 0 133 0.00000 -307499.21 - - 1s
0 0 -307491.42 0 146 0.00000 -307491.42 - - 1s
0 0 -303642.44 0 182 0.00000 -303642.44 - - 1s
0 0 -303552.16 0 181 0.00000 -303552.16 - - 1s
0 0 -301664.66 0 143 0.00000 -301664.66 - - 1s
0 0 -301604.34 0 150 0.00000 -301604.34 - - 1s
0 0 -298258.25 0 180 0.00000 -298258.25 - - 1s
0 0 -298251.26 0 185 0.00000 -298251.26 - - 1s
0 0 -293521.38 0 244 0.00000 -293521.38 - - 1s
0 0 -293274.88 0 229 0.00000 -293274.88 - - 1s
0 0 -286480.41 0 208 0.00000 -286480.41 - - 1s
0 0 -286195.53 0 229 0.00000 -286195.53 - - 1s
0 0 -282160.68 0 196 0.00000 -282160.68 - - 1s
0 0 -281269.57 0 246 0.00000 -281269.57 - - 2s
0 0 -273662.54 0 257 0.00000 -273662.54 - - 2s
0 0 -272041.60 0 264 0.00000 -272041.60 - - 2s
0 0 -271102.72 0 263 0.00000 -271102.72 - - 2s
0 0 -271090.84 0 282 0.00000 -271090.84 - - 2s
0 0 -270627.61 0 237 0.00000 -270627.61 - - 2s
0 0 -270617.70 0 254 0.00000 -270617.70 - - 2s
0 0 -269819.84 0 278 0.00000 -269819.84 - - 2s
0 0 -269816.88 0 249 0.00000 -269816.88 - - 2s
0 0 -269312.28 0 239 0.00000 -269312.28 - - 2s
0 0 -268268.06 0 258 0.00000 -268268.06 - - 2s
0 0 -267186.35 0 251 0.00000 -267186.35 - - 2s
0 0 -267173.15 0 273 0.00000 -267173.15 - - 2s
0 0 -266365.26 0 274 0.00000 -266365.26 - - 2s
0 0 -266347.92 0 287 0.00000 -266347.92 - - 2s
0 0 -266329.47 0 288 0.00000 -266329.47 - - 2s
0 0 -266327.67 0 290 0.00000 -266327.67 - - 2s
0 0 -266325.91 0 290 0.00000 -266325.91 - - 2s
0 0 -197094.29 0 180 0.00000 -197094.29 - - 2s
Explored 1 nodes (4975 simplex iterations) in 3.04 seconds (1.24 work units)
Thread count was 4 (of 4 available processors)
Solution count 2: 0 0
Optimal solution found (tolerance 1.00e-04)
Best objective 0.000000000000e+00, best bound 0.000000000000e+00, gap 0.0000%
Elapsed time is 119.355074 seconds.
My questions are as follows: 1. I didn't set the limit of the objective function, but the result was Objective range [1e+00, 1e+00]. I don't understand why this happened. If I want to modify it, how can I modify it?
2. The quadratic constraints I set are as follows:
V=sdpvar(11,20,'full');
V_12=sdpvar(11,20,'full');
V22=[12*ones(1,20);V_12];
0<=V,V<=1.1*12
0<=V22,V22<=1.1*1.1*12*12;
V22(i,t)==V(i,t)*V(i,t);
How can I correct the warning in the results?
3. In the last calculation, I got a value of 10 (-6) which is close to 0 but not 0, so I want to make the accuracy of the obtained result larger. If I want to set the accuracy of the result, how should I set it?
-
1. I didn't set the limit of the objective function, but the result was Objective range [1e+00, 1e+00]. I don't understand why this happened. If I want to modify it, how can I modify it?
The coefficient ranges describe the maximum and minimum coefficient in a given object. What is your objective function? You can check which objective function is used by writing your model to an LP file via the gurobi_write() function.
2. The quadratic constraints I set are as follows:
V=sdpvar(11,20,'full');
V_12=sdpvar(11,20,'full');V22=[12*ones(1,20);V_12];
0<=V,V<=1.1*12
0<=V22,V22<=1.1*1.1*12*12;V22(i,t)==V(i,t)*V(i,t);
How can I correct the warning in the results?
I assume that the warning you are referring to is the one about possible numerical issues. There are multiple ways to improve numerical behavior of a model. I recommend have a look at our Guidelines for Numerical Issues. However, often as long as your model is solved to optimality and the solution quality is acceptable, there is no need to apply any changes to your model (although it it certainly always strongly recommended).
3. In the last calculation, I got a value of 10 (-6) which is close to 0 but not 0, so I want to make the accuracy of the obtained result larger. If I want to set the accuracy of the result, how should I set it?
You can try decreasing computation tolerances FeasibilityTol, IntFeasTol, and experimenting with the NumericFocus and IntegralityFocus parameters. Note that this might degrade performance.
It is best to manually post-process the solution values. This means that you should check whether the solution values are acceptable or have to be rounded down or up to a certain integer value. Then, you should check whether the polished solution point is still a feasible one. This procedure should definitely be applied to all numerically questionable models.Best regards,
Jaromił0
Please sign in to leave a comment.
Comments
1 comment