id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc,merged,author,reviewer,upstream,work_issues,branch,commit,dependencies,stopgaps
14195,Bad error management in the CPLEX interface,ncohen,tbd,"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 """", line 9, in
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",defect,closed,major,sage-5.8,linear programming,fixed,,dcoudert dimpase,sage-5.8.beta3,Nathann Cohen,David Coudert,N/A,,,,,