Separating specific cuts
AnsweredDear support team,
I was trying to solve a MIP using Gurobi and Java. I will need to turn off all pre-solving, heuristics and separating options and solve the problem using pure Branch and Bound. Then I would like to apply a specific cut such as Gomory into a specific node.
Would you say, is it possible to do that using Gurobi? if so, how can I find any related documents, please?
Regards
Omidi. A
-
Hi,
You can add user cuts inside callbacks, but please be aware of the fact that they have to be globally valid. Please also see here for more details.
Gurobi already has Gomory cuts implemented. Are your cuts more specialized?
Best regards,
Sonja
0 -
Dear Sonja,
Thanks for your useful comments.
As you mentioned, I do not have any special cuts to add to the model. I will need to add some of the Cutting Planes (such as Gomory) separately and check whose behaviour on the model.
AFAIK, SCIP solver has such capabilities.
Would you please, say that is it possible with Gurobi?Regards
Abbas
0 -
- To disable Gurobi cut generation - including Gomory - set Cuts=0
- To disable Gurobi heuristics, set Heuristics=0
- To disable presolve, set Presolve=0. However, you may be better off setting PreCrush=1 instead
0 -
Hi,
With thanks for your useful comment, I try to use you mentioned parameters. I'm using Gurobi Java API. The parameters are set as follows:
model.set(GRB.IntParam.PreCrush, 1);
model.set(GRB.IntParam.Presolve, 0);
model.set(GRB.IntParam.Cuts, 0);
model.set(GRB.IntParam.NoRelHeuristic, 0);When I'm just using "preCrush", the result is:
Optimize a model with 9 rows, 25 columns and 45 nonzeros
Variable types: 20 continuous, 5 integer (5 binary)
Coefficient statistics:
Matrix range [1e+00, 2e+01]
Objective range [1e+03, 2e+04]
Bounds range [1e+00, 1e+00]
RHS range [1e+01, 2e+01]
Loaded MIP start with objective 210500
Presolve time: 0.00s
Presolved: 9 rows, 25 columns, 45 nonzeros
Variable types: 20 continuous, 5 integer (5 binary)
Root relaxation: objective 1.998333e+05, 11 iterations, 0.00 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
0 0 199833.333 0 1 210500.000 199833.333 5.07% - 0s
0 0 210252.941 0 2 210500.000 210252.941 0.12% - 0s
Cutting planes:
Gomory: 1
Explored 1 nodes (13 simplex iterations) in 0.01 seconds
Thread count was 4 (of 4 available processors)
Solution count 1: 210500
Optimal solution found (tolerance 1.00e-04)
Best objective 2.105000000000e+05, best bound 2.105000000000e+05, gap 0.0000%
TOTAL COSTS: 210500.0In the second step, I used "Presolve", "Cuts" and "NoRelHeuristic" and these had the flowing result:
Optimize a model with 9 rows, 25 columns and 45 nonzeros
Variable types: 20 continuous, 5 integer (5 binary)
Coefficient statistics:
Matrix range [1e+00, 2e+01]
Objective range [1e+03, 2e+04]
Bounds range [1e+00, 1e+00]
RHS range [1e+01, 2e+01]
Loaded MIP start with objective 210500
Variable types: 20 continuous, 5 integer (5 binary)
Root relaxation: objective 1.998333e+05, 11 iterations, 0.00 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
0 0 199833.333 0 1 210500.000 199833.333 5.07% - 0s
0 0 199833.333 0 1 210500.000 199833.333 5.07% - 0s
0 2 199833.333 0 1 210500.000 199833.333 5.07% - 0s
Explored 5 nodes (22 simplex iterations) in 0.01 seconds
Thread count was 4 (of 4 available processors)
Solution count 1: 210500
Optimal solution found (tolerance 1.00e-04)
Best objective 2.105000000000e+05, best bound 2.105000000000e+05, gap 0.0000%
TOTAL COSTS: 210500.0According to the results, In the second step, it seems that the parameters are disabled but, in the first step it does not work. Indeed, in some cases in the second step, the result shows "Found heuristic solution: objective 200.0000000".
I was wondering if, where I'm wrong in the first or second step? and have I used the true parameter setting?
Regards
0 -
Hi Abbas,
Greg suggested the PreCrush parameter as an alternative to the Presolve parameter for your situation. In either case, if you also want to disable cuts and heuristics, you still need to set the Cuts and Heuristics parameters.
Note that the NoRelHeuristic parameter only controls one type of heuristic. To completely disable Heuristics, you should set the Heuristics parameter to 0.
Thanks!
Eli
0 -
Dear Eli,
Thanks so much for your detailed explanation. I can do that.
Regards
0
Please sign in to leave a comment.
Comments
6 comments