Closed spoorendonk closed 3 years ago
Simon,
The reason you are getting those results is because after iteration 1 - see below -
On 07/12/2020 13:12, Simon Spoorendonk wrote:
I have a simple column generation problem where I need to add the columns twice (with |resolve()| twice) to get the correct dual variables. Am I missing a setting somewhere?
I use OsiClpSolverInterface, but get the same result with ClpSimplex directly.
My examples is:
In iteration 0, to obtain feasibility, I start with a phase 1 and have only artificial variables like
|\Problem name: ClpDefaultName Minimize obj: x0 + x1 Subject To cons0: x0 = 1 cons1: x1 = 1 cons2: x0 + x1 <= 2 cons2_low: x0 + x1 >= 1 Bounds 0 <= x0 <= 1 0 <= x1 <= 1 End |
with duals |[1, 1, 0] | after an |initialSolve()|.
Now I price in variables similar to |x0| and |x1| but with cost 0 to price out the artificial ones, so iteration 1 is
|\Problem name: ClpDefaultName Minimize obj: x0 + x1 Subject To cons0: x0 + x2 = 1 cons1: x1 = 1 cons2: x0 + x1 + x2 <= 2 cons2_low: x0 + x1 + x2 >= 1 Bounds 0 <= x0 <= 1 0 <= x1 <= 1 0 <= x2 <= 1 End |
then after |resolve()| i get duals |[1, 1, 0] | again. The problem is proven optimal and the objevtive value is 1, so the dual solution is off?
On the resolve x2 flips from 0 to 1 so - the primal solution is 0, 1, 1 but the reduced costs are 0, 0, -1 as x2 is at its upper bound. With the implied row x2 <= 1 the arithmetic works out.
If upper bounds are large then it works as expected.
John Forrest
Thanks.
Forgive me if my LP theory is a little rusty. Is it possible to force a resolve/pivot such that all reduced costs are >= 0? Which I guess would lead to the dual solution I am looking for?
Not if any upper bounds are active.
So for instance if you modify LP_1.lp to give x2 an upper bound of 0.9, then the optimal solution of 1.1 has to have x2 at upper bound with reduced cost of -1. As I wrote in my previous note you would need to have upper bounds on all variables as infinity.
On 07/12/2020 18:40, Simon Spoorendonk wrote:
Thanks.
Forgive me if my LP theory is a little rusty. Is it possible to force a resolve/pivot such that all reduced costs are >= 0? Which I guess would lead to the dual solution I am looking for?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/coin-or/Clp/issues/167#issuecomment-740103569, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWJYHFMXI53IDLPJWCBHP3STUORRANCNFSM4UQOCYOA.
Allright. Infinity it is. Thanks again.
I have a simple column generation problem where I need to add the columns twice (with
resolve()
twice) to get the correct dual variables. Am I missing a setting somewhere?I use OsiClpSolverInterface, but get the same result with ClpSimplex directly.
My examples is:
In iteration 0, to obtain feasibility, I start with a phase 1 and have only artificial variables like
with duals
[1, 1, 0]
after aninitialSolve()
.Now I price in variables similar to
x0
andx1
but with cost 0 to price out the artificial ones, so iteration 1 isthen after
resolve()
i get duals[1, 1, 0]
again. The problem is proven optimal and the objevtive value is 1, so the dual solution is off?If a I price in the same variable again, ie.,
and
resolve()
I get the correct duals[0, 1, 0]
. The same problem occurs when pricing in the next variable (and pricing outx1
).My code is