[Osi] A few questions after one week of usage

Sylvain R ross_dev at hotmail.com
Mon Jul 11 05:32:48 EDT 2011


Hello,
I have been spending the previous week discovering and playing with OSI and I am very happy with what I have been able to do so far. I spent some time in the actual OSI (and solver specific as well) code to find most of my answers but I have still a few questions:
1) How can I get the generated lp files to have the column/row names specified?
I am extensively using writeLP to experiment but I can't seem to get the proper column and row names right: I would get default names such as x1, x2, and cons1, cons2 etc... I tried all OsiNameDiscipline (0, 1, 2) with Glpk, Clp and CPLEX, and I mostly failed. The furthest I got was with GLPK: I got row names in the generated MPS file.
I am setting the column names right after calling the loadProblem routine (and I tried in other places as well but with no luck). I am doing something wrong? or am I trying to do something impossible? :)

2) How should I fix Integer/boolean variables to get duals?
I basically need to be able to get the shadow cost of some constraints of a MIP problem. Calling getRowPrice fails after solving the problem calling branchAndBound(). In CPLEX there was a method that would fix the integer variables and resolve the LP problem. I saw a mail-thread that would say that there is no such built in capability in OSI. 
So, unless it has been added since then (which I doubt after looking in the source code), how should I do that in the most efficient manner? - Should I look into the reducedCostFix() method?- Should I just loop through all the integer variables (with isInteger()), read its optimal value (after branchAndCut) and set the bounds (with setColBounds)?
What is the most efficient way to do that?A quick background on my goal: I am solving many LP/MIP problems in a sequence, therefore, the run-time to load the problem to the solver via OSI is important to me.

Thank you very much in advance!
Sylvain 		 	   		  




More information about the Osi mailing list