ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 11 Jun 2013 10:04:37 +0200wrong Answer in MILP :sagehttps://ask.sagemath.org/question/10203/wrong-answer-in-milp-sage/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 Thu, 06 Jun 2013 22:25:32 +0200https://ask.sagemath.org/question/10203/wrong-answer-in-milp-sage/Comment by Aissan_Dalvandi for <p>hello everyone ....</p>
<p>I have MILP optimization problem. when I solve the problem and use the get_values function:</p>
<p>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.....</p>
<p>any suggestion.....???</p>
<p>Thanks
Aissan </p>
https://ask.sagemath.org/question/10203/wrong-answer-in-milp-sage/?comment=17528#post-id-17528yes 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 Tue, 11 Jun 2013 10:01:04 +0200https://ask.sagemath.org/question/10203/wrong-answer-in-milp-sage/?comment=17528#post-id-17528Comment by Aissan_Dalvandi for <p>hello everyone ....</p>
<p>I have MILP optimization problem. when I solve the problem and use the get_values function:</p>
<p>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.....</p>
<p>any suggestion.....???</p>
<p>Thanks
Aissan </p>
https://ask.sagemath.org/question/10203/wrong-answer-in-milp-sage/?comment=17527#post-id-17527I 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 ...Tue, 11 Jun 2013 10:04:37 +0200https://ask.sagemath.org/question/10203/wrong-answer-in-milp-sage/?comment=17527#post-id-17527Comment by tmonteil for <p>hello everyone ....</p>
<p>I have MILP optimization problem. when I solve the problem and use the get_values function:</p>
<p>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.....</p>
<p>any suggestion.....???</p>
<p>Thanks
Aissan </p>
https://ask.sagemath.org/question/10203/wrong-answer-in-milp-sage/?comment=17545#post-id-17545There should not be any problem with that since:
sage: -0.0 == 0
True
sage: 0.0 == 0
True
Could you provide a concrete example ?
Fri, 07 Jun 2013 02:59:31 +0200https://ask.sagemath.org/question/10203/wrong-answer-in-milp-sage/?comment=17545#post-id-17545