[Cbc] please help me

Thomas Vincent thomas.vincent at univ-nantes.fr
Tue Oct 2 07:50:14 EDT 2012


Hi,


On 19/09/2012 09:45, 刘峰 wrote:
> Dear Sir:
>          My name is LiuFeng, I am a student of Computer Science In Ji Lin
> University of China. I am learning to use CBC Library to solve some MIP
> problems. I met a problem,but I don't know how to solve it.
>          The problem is as follows.
>           It is an Integer Programming problem.
>           The target function is Min z=x1 + x2 + x3 + x4
>           The Constraints are
>                                              4*x1 + 3*x2  +
> 2*x3             =2
>                                                             x2 +  2*x3 +
> 5*x4 = 2
>                                              xi >= 0 (i=1,2,3,4) all of
> them have the constraint of integer.


This should work with the following "matrix" part :

  // matrix
  start[0]=0; index[0] = 0; value[0] = 4.0;
  start[1]=1; index[1] = 0; value[1] = 3.0;
  index[2] = 1; value[2] = 1.0;
  start[2]=3; index[3] = 0; value[3] = 2.0;
  index[4] = 1; value[4] = 2.0;
  start[3]=5; index[5] = 1; value[5] = 5.0;
  start[4]=6;

Indices in the value array were incorrect.

Cheers,
Thomas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20121002/5aaa08f5/attachment.sig>


More information about the Cbc mailing list