In the C Callable library, you can use functions CPXaddrows (CPXcutcallbackadd if you are adding a cut from within a callback function) to add a row to the LP model.
After adding a violated cut, the previous solution becomes infeasible. *As far as possible*, (subject to other constraints) CPLEX will try to use a previous existing basis. Usage of dual simplex optimizer will ensure that you do not restart from scratch after adding a new violated cut.
This is similar to the case where you add a new column/variable. If you use the primal simplex algorithm, the current solution continues to remain feasible, although not provably optimal yet. So, primal simplex algorithm can start from the pre-existing basis.
To verify indeed that CPLEX is doing what you expect it to do (not restarting optimization from scratch) use function getNIterations after a call to the optimizer to find out how many iterations CPLEX took to reoptimize the basis. If CPLEX reoptimized the problem from start, you should see a relatively high number here.
------------------------------
CPLEX User
------------------------------
Original Message:
Sent: Wed February 09, 2022 11:01 AM
From: Babak Akbarzadeh
Subject: How to add a cut?
Dear all,
I have a question about adding cuts to the model. Note that, I am programming in C#, but If you are using other frameworks and you know my answer, I will be happy to read how you do it.
I am trying to implement Branch, Cut and Price algorithm. Now I have a column-based master model using "range" and "column", and I solved it to optimality. Now I am trying to add cuts, but I do not know how to do it. What I am concerned about is, after adding the cuts, I do not want to optimize the model from the beginning, in fact, I want to reoptimize the model from the optimal point of the model without cuts. Briefly,
1- How do you add a cut in the column-based model?
2- When you re-optimize the model after adding cut, does it start from the beginning?
------------------------------
Babak Akbarzadeh
------------------------------
#DecisionOptimization