[Coin-lpsolver] solving a small MIP

Stefan Vigerske stefan at mathematik.hu-berlin.de
Fri Apr 14 13:01:21 EDT 2006


Hi,

I try to solve MIPs with OsiClpSolverInterface and got a bit confused about 
return codes and others.
I've tried now the simple example
max 4x1 -  x2
	7x1 - 2x2    <= 14
	x2    <= 3
	2x1 - 2x2    <= 3
	x1 in Z+, x1<=10, x2 >= 0
It's a little modified version (adding x1<=10) of one of the unit tests.
Since the variables are bounded and (x1,x2)=(0,0) is a feasible point, there 
should be now problem for Clp to solve it.

I first called branchAndBound(). After that, isProvenOptimal() returns true, 
but also isDualObjectiveLimitReached() returns true.

After that, I wanted to solve the LP relaxation only. But having a look at the 
B&B code shows that at the end of the B&B the bounds of the integer variables 
are fixed to the integer solution. So I'm calling setColBounds(0, 0., 10.) to 
set a proper bound again and call resolve().
This solves the model, isProvenOptimal() returns true and 
isDualObjectiveLimitReached() returns false.

Next, running branchAndBound() again, the first two nodes in the B&B turn out 
to be infeasible and the algorithm stops, even when the problem is the same 
as in the beginning. isProvenOptimal() returns false and 
isDualObjectiveLimitReached() returns true.

Here comes the complete output. I'm attaching the sourcefile.

B&B: m.setInteger(0); m.branchAndBound();
Coin0506I Presolve 2 (-1) rows, 2 (0) columns and 4 (-1) elements
Clp0006I 0  Obj 0 Dual inf 2.13809 (1)
Clp0006I 1  Obj -8.42857
Clp0000I Optimal - objective value -8.42857
Coin0511I After Postsolve, objective -8.42857, infeasibilities - dual 0 (0), 
primal 0 (0)
Clp0032I Optimal objective -8.428571429 - 1 iterations time 0.002, Presolve 
0.00
Clp0006I 0  Obj -8.42857 Primal inf 0.267261 (1)
Clp0001I Primal infeasible - objective value -8.42857
Clp0006I 0  Obj -8.42857 Primal inf 1.60357 (1)
Clp0006I 2  Obj -7.5
Clp0000I Optimal - objective value -7.5
Integer solution of -7.5 found after 2 iterations and 3 nodes
Search took 2 iterations and 3 nodes
Clp0000I Optimal - objective value -7.5
isProvenOptimal: 1
isDualObjectiveLimitReached: 1

Resolve: m.setColBounds(0, 0., 10.); m.resolve();
Clp0006I 0  Obj -31.5 Primal inf 14.4443 (2)
Clp0006I 2  Obj -8.42857
Clp0000I Optimal - objective value -8.42857
isProvenOptimal: 1
isDualObjectiveLimitReached: 0

B&B again: m.branchAndBound();
Clp0006I 0  Obj -8.42857
Clp0006I 0  Obj -8.42857
Clp0000I Optimal - objective value -8.42857
Clp0006I 0  Obj -8.42857 Primal inf 0.267261 (1)
Clp0001I Primal infeasible - objective value -8.42857
Clp0006I 0  Obj -8.42857 Primal inf 1.60357 (1)
Clp0006I 2  Obj -7.5
Clp0001I Primal infeasible - objective value -7.5
Search took 2 iterations and 2 nodes
isProvenOptimal: 0
isDualObjectiveLimitReached: 1

Stefan

-- 
Stefan Vigerske
Humboldt University Berlin, Numerical Mathematics
http://www.math.hu-berlin.de/~stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clptest1.cpp
Type: text/x-c++src
Size: 1596 bytes
Desc: not available
URL: <http://list.coin-or.org/pipermail/clp/attachments/20060414/40532a8e/attachment.bin>


More information about the Clp mailing list