wrong Answer in MILP :sage

asked 2013-06-06 22:25:32 +0200

Aissan_Dalvandi gravatar image

updated 2013-06-10 08:35:37 +0200

tmonteil gravatar image

hello everyone ....

I have MILP optimization problem. when I solve the problem and use the get_values function:

Although I sets the variables BINARY but it give me real values like(+0.0) or (-0.0).... it caused I get the value wrong because when i check the value ==0 or ==1 in this case i receive the wrong answer.....

any suggestion.....???

Thanks Aissan

edit retag flag offensive close merge delete

Comments

There should not be any problem with that since: sage: -0.0 == 0 True sage: 0.0 == 0 True Could you provide a concrete example ?

tmonteil gravatar imagetmonteil ( 2013-06-07 02:59:31 +0200 )edit

yes I checked ........ I found the problem .... I used the get value, since it give me the real value sometimes it give some value near the zero or one

Aissan_Dalvandi gravatar imageAissan_Dalvandi ( 2013-06-11 10:01:04 +0200 )edit

I considered the if which check the value if it bigger than 0.5 it consider 1 otherwise zero ...... anyway I am so grateful for all your consideration ...

Aissan_Dalvandi gravatar imageAissan_Dalvandi ( 2013-06-11 10:04:37 +0200 )edit