#14195: Bad error management in the CPLEX interface
-----------------------------+----------------------------------------------
   Reporter:  ncohen         |             Owner:  tbd          
       Type:  defect         |            Status:  new          
   Priority:  major          |         Milestone:  sage-5.8     
  Component:  PLEASE CHANGE  |          Keywords:               
Work issues:                 |   Report Upstream:  N/A          
  Reviewers:                 |           Authors:  Nathann Cohen
  Merged in:                 |      Dependencies:               
   Stopgaps:                 |  
-----------------------------+----------------------------------------------
 Helloooooooooooo !!!

 Recently a test did not pass in `generic_graph.py` when using CPLEX. And I
 got the same problem with a MILP I am work on, the two of them being
 probably related by their common use of constants with many decimals.

 {{{
 **********************************************************************
 File "/home/ncohen/.Sage/devel/sage-2/sage/graphs/generic_graph.py", line
 5779:
     sage: for i in range(20):
           g = DiGraph()
           g.allow_multiple_edges(False)
           for u,v in
 digraphs.RandomDirectedGNP(n,RealNumber('.2')).edges(labels = False):
                g.add_edge(u,v,round(random(),Integer(5)))
           for u,v in digraphs.Circuit(n).edges(labels = False):
                if not g.has_edge(u,v):
                    g.add_edge(u,v,round(random(),Integer(5)))
           v2 = g.traveling_salesman_problem(use_edge_labels = True)
           v1 = g.traveling_salesman_problem(constraint_generation = False,
 use_edge_labels = True)
           c1 = sum(map(itemgetter(Integer(2)), v1.edges()))
           c2 = sum(map(itemgetter(Integer(2)), v2.edges()))
           if c1 != c2:
               print "Error !",c1,c2
               print "With constraint generation :",c2
               print "Without constraint generation :",c1
               break
 Exception raised:
     Traceback (most recent call last):
       File "/home/ncohen/.Sage/local/bin/ncadoctest.py", line 1231, in
 run_one_test
         self.run_one_example(test, example, filename, compileflags)
       File "/home/ncohen/.Sage/local/bin/sagedoctest.py", line 38, in
 run_one_example
         OrigDocTestRunner.run_one_example(self, test, example, filename,
 compileflags)
       File "/home/ncohen/.Sage/local/bin/ncadoctest.py", line 1172, in
 run_one_example
         compileflags, 1) in test.globs
       File "<doctest __main__.example_74[24]>", line 9, in <module>
         v2 = g.traveling_salesman_problem(use_edge_labels = True)
       File "/home/ncohen/.Sage/local/lib/python/site-
 packages/sage/graphs/generic_graph.py", line 5922, in
 traveling_salesman_problem
         raise ValueError("The given graph is not hamiltonian")
     ValueError: The given graph is not hamiltonian
 **********************************************************************
 }}}

 This is because the two variables that are currently used in Sage to
 detect whether the problem is unfeasible or unbounded do not actually say
 whether the PROBLEM has this property, but whether the "current solution"
 has "been checked to satisfy" this property. Hence, a difference.

 This patch uses the correct variable. And the doctest pass, and my MILP
 which are NEVER unbounded are not unbounded either `:-P`

 Nathann

 
http://pic.dhe.ibm.com/infocenter/cosinfoc/v12r5/index.jsp?topic=%2Filog.odms.cplex.help%2Frefcallablelibrary%2Fhtml%2Ffunctions%2FCPXsolninfo.html

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14195>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to