[Coin-discuss] Osi interfaces do not return MIP status appropriately!
Vishy Jeet
vishv.jeet at gmail.com
Wed May 16 12:29:23 EDT 2007
Hi John,
Thanks for the response. I was using a different approach to get access to
function available in OsiCbcSolverInterface class. I was writing MPS and
creating an CbcModel object using the MPS file...
For some reason the function call getModelPtr() which is obviously a much
cleaner approach didn't work, since I could not compile my Flopcpp program
if I access getModelPtr() function.
I get the following error
error: 'class OsiSolverInterface' has no member named 'getModelPtr'
I know getModelPtr() is declared in 'class OsiCbcSolverInterface' not in
'class OsiSolverInterface' but I don't know how to tell it to my Flopcpp
program. In fact from Flopcpp I can't even call Solver->branchAndBound()
function directly.
regards,
vishy
On 5/16/07, John J Forrest <jjforre at us.ibm.com> wrote:
>
> Vishy,
>
> OsiCbcSolverInterface is just like Osi...SolverInterface in many ways, so
> those functions are returning values for the last continuous solve - not
> for branch and bound.
>
> Look at Cbc specific public interfaces. So use ->status() to see if
> search
> completed. You may also need to use functions such as getModelPtr()->
> isProvenOptimal() which ask questions of the underlying cbc solver.
>
> John Forrest
>
>
>
> "Vishy Jeet"
> <vishv.jeet at gmail
> .com> To
> Sent by: coin-discuss at list.coin-or.org
> coin-discuss-boun cc
> ces at list.coin-or.
> org Subject
> [Coin-discuss] Osi interfaces do
> not return MIP status
> 05/14/07 05:47 PM appropriately!
>
>
> Please respond to
> Discussions about
> open source
> software for
> Operations
> Research
> <coin-discuss at lis
> t.coin-or.org>
>
>
>
>
>
>
>
> Hi everyone,
>
> I am using an MPS file which is located at the following location:
> http://uts.cc.utexas.edu/~jeetv/MIPproblem.mps. (too big to be posted
> here...)
>
> When I am using the following code it returns the message isAbandoned
> regardless
> whether branchAndBound() is called or not....but if I use Cbc solver
> directly, it returns the primal infeasibility. Could you check if the
> status functions (called in the code below) written
> OsiCbcSolverInterface()
> are working properly..
>
> regards,
> vishy
>
> Code for solving the MPS file using Osi interface:
>
> #include <iostream.h>
> #include "OsiCbcSolverInterface.hpp"
>
>
> int main() {
> MP_model my_knap(new OsiCbcSolverInterface);
> int num_err = 0;
> num_err = my_knap->readMps("MIPproblem");
> if(num_err != 0)
> cout << "errors reading MPS file\n";
>
> my_knap->branchAndBound();)
>
>
> if( my_knap->isProvenPrimalInfeasible() == true)
> cout << "primal infeasible\n";
> if( my_knap->isProvenDualInfeasible() == true)
> cout << "dual infeasible\n";
> if( my_knap->isAbandoned() == true)
> cout << "isAbandoned\n";
> if( my_knap->isProvenOptimal() == true)
> cout << "isProvenOptimal\n";
> if( my_knap->isDualObjectiveLimitReached() == true)
> cout << "isDualObjectiveLimitReached\n";
> if( my_knap->isPrimalObjectiveLimitReached() == true)
> cout << "isPrimalObjectiveLimitReached\n";
> if( my_knap->isIterationLimitReached() == true)
> cout << "isIterationLimitReached\n";
> }
>
>
> executabe prints "isAbandoned"....
>
>
>
> Code for solving the MPS file using Cbc directly:)
>
> Using minimum.cpp in Cbc examples --aalong with the following test:
>
> 33 if (model.isProvenInfeasible () == true)
> 34 cout<< "YES"<<endl;
> 35 else
> 36 cout<< "NO"<<endl;
>
> executabe prints "YES"....
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> Best Regards,
> Vishv Jeet, Ph.D.,
> Operations Research Scientist,
> Gravitant Inc.,
> (The Business Governance Company)
> http://www.gravitant.com.
> Austin, TX, USA.
> Cell : 1-512-657-8678
> Home : 1-512-788-5795
> Work : 1-512-535-7399
> _______________________
> Youngest Music Meastro
> http://www.mayanksahu.net. _______________________________________________
> Coin-discuss mailing list
> Coin-discuss at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/coin-discuss
>
>
> _______________________________________________
> Coin-discuss mailing list
> Coin-discuss at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/coin-discuss
>
--
Best Regards,
Vishv Jeet, Ph.D.,
Operations Research Scientist,
Gravitant Inc.,
(The Business Governance Company)
http://www.gravitant.com
Austin, TX, USA.
Cell : 1-512-657-8678
Home : 1-512-788-5795
Work : 1-512-535-7399
_______________________
Youngest Music Meastro
http://www.mayanksahu.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/coin-discuss/attachments/20070516/ebd51c12/attachment.html>
More information about the Coin-discuss
mailing list