Opened 7 years ago

Closed 7 years ago

#12019 closed defect (fixed)

doctest failure in linear_programming.rst (multiple correct solutions)

Reported by: emil Owned by: ncohen
Priority: minor Milestone: sage-4.8
Component: linear programming Keywords: doctests, linear programming, GLPK, multible solutions
Cc: ncohen Merged in: sage-4.8.alpha3
Authors: Nathann Cohen Reviewers: Emil Widmann
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by emil)

sage -t -force_lib "devel/sage/doc/en/thematic_tutorials/ linear_programming.rst" ********************************************************************** File "/mnt/sda6/COMPILE/sage-4.7.2/devel/sage/doc/en/ thematic_tutorials/linear_programming.rst", line 366:

  sage: [e for e,b in matching.iteritems() if b == 1]

Expected:

  [(0, 1), (6, 9), (2, 7), (3, 4), (5, 8)]

Got:

  [(1, 6), (0, 4), (2, 3), (5, 8), (7, 9)]

**********************************************************************

The result is correct but it is different from the expected solution. The tested problem has multiple solutions and it seems that the result of the example is machine dependent.

The proposed fix is to flag the example as "not tested" and also to change the documentation so that users are aware that there is more than one correct solution.

I don't know the reason for this dependency but Nathann Cohen mentioned it might depend on the GLPK library.

http://groups.google.com/group/sage-devel/browse_thread/thread/e1886d5ba5ade945

Attachments (2)

trac_12019.patch (752 bytes) - added by ncohen 7 years ago.
hardinfo_report.html (43.3 KB) - added by emil 7 years ago.
"Info about system, where this error occured!

Download all attachments as: .zip

Change History (12)

comment:1 Changed 7 years ago by emil

  • Description modified (diff)

Changed 7 years ago by ncohen

comment:2 Changed 7 years ago by ncohen

  • Status changed from new to needs_review

I think that adding a flag "not tested" to this line is more than sufficient in this case. The LP code is being tested in so many places (and the matching stuff too), that everything would fail (and actually does, when there is the slightest bug with MIP) if there is anything wrong.

Nathann

comment:3 Changed 7 years ago by jdemeyer

I would like to know on which system these failures occur. Sage has been widely tested on many different systems, so I'm surprised to see this failure.

comment:4 Changed 7 years ago by emil

this one seems food enough for me... I attach system report :-) strange thing is, it happened the first time for me

comment:5 Changed 7 years ago by emil

I mean the error was not there with the previous versions I compiled (4.31, 4.32, 4.6, 4.61)

Changed 7 years ago by emil

"Info about system, where this error occured!

comment:6 Changed 7 years ago by emil

  • Status changed from needs_review to positive_review

comment:7 Changed 7 years ago by jdemeyer

  • Authors set to Nathann Cohen
  • Work issues assessment if funtionality is tested elsewhere, if not create TEST section with example with unique solution, change help docstring so users are aware of multible solutions deleted

emil: write your name as Reviewer on this ticket and also add yourself to http://trac.sagemath.org/sage_trac/#AccountNamesMappedtoRealNames

comment:8 Changed 7 years ago by emil

  • Reviewers set to emil

comment:9 Changed 7 years ago by jdemeyer

  • Reviewers changed from emil to Emil Widmann

comment:10 Changed 7 years ago by jdemeyer

  • Merged in set to sage-4.8.alpha3
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.