Problem with callback function
ユーザーの入力を待っています。Hello
I am implementing a branch and Benders cut algorithm by using a callback function with lazy constraints. When I run my code an integer solution is found at the root node, and I add a (lazy) constraint at this node. However, after adding the constraint, the optimization is finished reporting an infeasible problem. This cannot be the case for the instance I am solving since I can solve the .lp file in which the lazy constraint is added manually, and I get an optimal solution from there.
A simplified version of my callback function is below. I am wondering if something is wrong with the implementation of the callback function. I would appreciate it if you could provide me with any suggestions regarding this.
///////////////////////////////////////////////////////////////////////////////////////////////////////
Set parameter Username
Set parameter LogFile to value "mip1.log"
Academic license - for non-commercial use only - expires 2025-04-29
Set parameter TimeLimit to value 86000
Set parameter Threads to value 1
Set parameter MIPGap to value 1e-05
Set parameter IntFeasTol to value 1e-07
Set parameter LazyConstraints to value 1
Gurobi Optimizer version 11.0.1 build v11.0.1rc0 (win64 - Windows 11.0 (22631.2))
CPU model: Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz, instruction set [SSE2|AVX|AVX2|AVX512]
Thread count: 4 physical cores, 8 logical processors, using up to 1 threads
Optimize a model with 1308 rows, 1274 columns and 2616 nonzeros
Model fingerprint: 0x9a5fa3e7
Variable types: 1 continuous, 1273 integer (1273 binary)
Coefficient statistics:
Matrix range [1e+00, 1e+00]
Objective range [1e+00, 2e+04]
Bounds range [1e+00, 4e+06]
RHS range [0e+00, 0e+00]
Explored 0 nodes (0 simplex iterations) in 0.03 seconds (0.00 work units)
Thread count was 1 (of 8 available processors)
Solution count 0
Model is infeasible
Best objective -, best bound -, gap -
User-callback calls 23, time in user-callback 0.03 sec
Optimization status: 3
Let me know if you need further information regarding my code or instances.
Thank you!
Regards,
Mario
-
Hi Mario,
You are saying
This cannot be the case for the instance I am solving since I can solve the .lp file in which the lazy constraint is added manually, and I get an optimal solution from there.
But I see that your callback has been called 23 times, so there has been probably more lazy constraints added than only one. Could you please double check that?
Moreover, could you please share the way how you generate the lazy constraint you added to the model manually? If possible, could you please share the log output of the run of the model with manually added lazy constraint?
Best regards,
Jaromił0
サインインしてコメントを残してください。
コメント
1件のコメント