[Flopcpp] A FlopC++ Bug?

Tim Hultberg Tim.Hultberg at eumetsat.int
Mon Feb 27 09:15:31 EST 2006


Its not an error.

A constraint is not quite the same as an assignement.

Your variables get values assigned when the problem is solved. Since there are no constraints on x(0,0,0,1) except beeing binary, the solver is free to give it any value (0 or 1) it pleases.

Put another way:

generating a constraint: x(0,0,0,0) == 1 ensures that  x.level(0,0,0,0) will be 1
however NOT generating x(0,0,0,1)==1 does NOT ensure that x.level(0,0,0,1) will be 0 

Tim 

Tim Hultberg


>>> <WoelliUSM at aol.com> 27/02/2006 15:02 >>>
Dear Tim,
 
thanks again for your help!
 
I know, that x(0,0,0,1) doesnt enter the cost function, but to my mind, the  
assignment of x(0,0,0,1) is still wrong.
 
In my example, x should consist of 5 "ones", the rest zeros. But there are  
25 "ones" !
 
The constraint has to make sure, that there are only 5 assignments! Even if  
there is in that case no problem with 25 assignments, I believe that this  
problem affects an other constraint of mine, which I didn't publish. 
 
So my question:
 
Is this an error?
 
Thanks again,
 
Christian




More information about the Flopcpp mailing list