[Cbc] bestSolution() return decimal number for integer variable

Haroldo Gambini Santos haroldo.santos at gmail.com
Fri Jun 20 19:10:51 EDT 2014


Hi Patrik,

This is expected.

The simplex method performs a series of operations with limited 
precision numbers, so that the final result is an approximation (usually 
a good one) of the optimal solution.

Usually rounding numbers up to the 8-th decimal place should give you 
the right integral values.

Cheers,

Haroldo

On 20-06-2014 13:30, Patrik Dufresne wrote:
> Hello,
>
> Sometime, when I make a call to bestSolution() to retreive the 
> solution to a MIP, the array return a number htat is not equal to 
> zero(0) or one(1).
> e.g.:
> 0.9999999999988346
> 0.9999999999999998
> 0.9999999999999998
> 0.999999999999899
> 1.0000000000000004
>
> Am I doing something wrong ? Why is the variable not fixed to either 0 
> or 1 ?
>
> --
> Patrik Dufresne Service Logiciel
> http://patrikdufresne.com <http://patrikdufresne.com/>/
> 514-971-6442 <tel:514-971-6442>
> 438-738-1376 <tel:438-738-1376>
> 114 rue des Hautbois, app1
> St-Colomban, QC J5K 2H6
>
>
> _______________________________________________
> Cbc mailing list
> Cbc at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/cbc

-- 
==================================================
Haroldo Gambini Santos
D.Sc, Computer Science
Universidade Federal de Ouro Preto
http://www.decom.ufop.br/haroldo/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20140620/38d08b38/attachment.html>


More information about the Cbc mailing list