[Coin-discuss] Comments on OSI for CPLEX and Xpress MP

Kish Shen ks15 at icparc.ic.ac.uk
Wed May 5 08:07:11 EDT 2004


Hi,

I have been trying out COIN/OSI as a way of interfacing to LP/MIP solvers
for our Constraint Logic Programming language, ECLiPSe. To give you some
context, we have been developing our own interface to CPLEX and Xpress MP for
some years now, and so OSI was an interesting comparison.

I am doing my development on Linux. I have so far got a prototype interface
working with CPLEX 6.5, and a recent (late April) download of CLP. 

I had to modify OSiCpxSolverInterface.cpp in two places to get it working
with CPLEX 6.5:


1) In OsiCpxSolverInterface::incremntInstanceCounter():

      err = sscanf( CPXversion( env_ ), "%d.%d.%d", &cpxVersionMajor_, &cpxVersionMinor_, &cpxVersionMinorMinor_ );
      //assert( err == 3 );

     I had to comment out the assert, as it was failing (I assume because
     CPlex 6.5 did not have a `minor minor' version)

2) In OsiCpxSolverInterface::isProvenOptimal(), I had to add a test for
   CPX_STAT_OPTIMAL_TOL, as the first MIP example I tried returned this
   status, and I was unable to test for this with the existing OSI calls:

#if CPX_VERSION >= 800
  return ((probtypemip_ == false && 
	  (stat == CPX_STAT_OPTIMAL || stat == CPX_STAT_OPTIMAL_INFEAS)) ||
	  probtypemip_ == true && (stat == CPXMIP_OPTIMAL || stat == CPXMIP_OPTIMAL_TOL));
#else
  return ((probtypemip_ == false && 
	  (stat == CPX_OPTIMAL || stat == CPX_OPTIMAL_INFEAS)) ||
	  probtypemip_ == true && ( stat == CPXMIP_OPTIMAL || stat == CPXMIP_OPTIMAL_TOL));
#endif

--------

Some more general comments/questions:

Is there some overview documentation for OSI? For exmaple, I had to
experiment to find out that for solving a MIP problem, I needed to make a
call to InitialSolve() first. The tutorial at Leihigh University was very
helpful for the linear problems, but it did not show a MIP problem.


I have also tried briefly to get the interface working with Xpress MP
14.27, but have not succeeded yet. I noticed that the Xpress calls are
using the old interface, which DASH changed with version 13 of Xpress MP,
although there is still a `compatibility' mode, which they tell me will be
dropped at some point.

Yours sincerely,

Kish Shen
IC-Parc
Imperial College London
U.K.



More information about the Coin-discuss mailing list