[Coin-discuss] Python port of OSI

Andrea Nerli anerli at mbigroup.it
Mon May 19 06:11:20 EDT 2008


Hi all,

I'm working on a python module to use OSISolverInterface
( using Boost-python ). The idea is to have a pyOSI.so (dll in Windows) 
to do something as:

import pyOSI

theSI = pyOSI.getOsiClp()

#Read in an mps file.  This one's from the MIPLIB library.
#si->readMps("../../Data/Sample/p0033");
theSI.readMps("p0033")

#Solve the (relaxation of the) problem
theSI.initialSolve()

#Check the solution
if ( theSI.isProvenOptimal() ):
       print "Found optimal solution!"
       print "Objective value is %f" % theSI.getObjValue()
       n = theSI.getNumCols()
       solution = theSI.getColSolution()
       for i in solution:
             print i

else:
       print "Didn't find optimal solution."

and this is what I have done at the moment.
Please, let me know if someone is interested.
Thanks,
Andrea



More information about the Coin-discuss mailing list