#16497: Rounding problem with CBC and gurobi LP solvers
-------------------------------------+-------------------------------------
       Reporter:  tmonteil           |        Owner:
           Type:  defect             |       Status:  new
       Priority:  major              |    Milestone:  sage-6.3
      Component:  packages:          |   Resolution:
  optional                           |    Merged in:
       Keywords:                     |    Reviewers:
        Authors:                     |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  7c2fb38a2ae24e8c59c5fce8dc0c42967a6ef7c2
  u/tmonteil/rounding_problem_with_cbc|     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Old description:

> Running `make ptestlong` with CBC package installed leads to the
> following doctest errors:
>
> {{{
> File "src/doc/en/thematic_tutorials/linear_programming.rst", line 442, in
> doc.en.thematic_tutorials.linear_programming
> Failed example:
>     p.solve()
> Expected:
>     2.0
> Got:
>     1.0
> }}}
>
> {{{
> File "src/sage/graphs/graph.py", line 3215, in
> sage.graphs.graph.Graph.minimum_outdegree_orientation
> Failed example:
>     max(o.out_degree()) == ceil((4*3)/(3+4))
> Expected:
>     True
> Got:
>     False
> }}}
>
> {{{
> File "src/sage/numerical/optimize.py", line 777, in
> sage.numerical.optimize.binpacking
> Failed example:
>     all([ (v in b1 or v in b2 or v in b3) for v in values ])
> Expected:
>     True
> Got:
>     False
> }}}

New description:

 Running `make ptestlong` with CBC package installed leads to the following
 doctest errors:

 {{{
 File "src/doc/en/thematic_tutorials/linear_programming.rst", line 442, in
 doc.en.thematic_tutorials.linear_programming
 Failed example:
     p.solve()
 Expected:
     2.0
 Got:
     1.0
 }}}

 {{{
 File "src/sage/graphs/graph.py", line 3215, in
 sage.graphs.graph.Graph.minimum_outdegree_orientation
 Failed example:
     max(o.out_degree()) == ceil((4*3)/(3+4))
 Expected:
     True
 Got:
     False
 }}}

 {{{
 File "src/sage/numerical/optimize.py", line 777, in
 sage.numerical.optimize.binpacking
 Failed example:
     all([ (v in b1 or v in b2 or v in b3) for v in values ])
 Expected:
     True
 Got:
     False
 }}}

 The problem seems to come from `get_variable_value` method in the CBC
 backend that does not round its result when the variable is binary.
 Actually, the same problems exists for integer variables in both gurobi
 and CBC backends (at least), but no doctest detects it.

--

Comment (by tmonteil):

 New commits:
 
||[http://git.sagemath.org/sage.git/commit/?id=bc1cc7d411fd805879f3c179b6dfaf28c69fe5fc
 bc1cc7d]||{{{first attempt inspired from gurobi_backend}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=7c2fb38a2ae24e8c59c5fce8dc0c42967a6ef7c2
 7c2fb38]||{{{16497 : fix the integer case for gurobi and cplex}}}||

--
Ticket URL: <http://trac.sagemath.org/ticket/16497#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to