[Bonmin] does cpu time limit change the result?
Giuseppe Aprea
giuseppe.aprea at gmail.com
Thu Jul 9 09:05:27 EDT 2009
Hi,
The suggestion you gave me was good to stop Bonmin but I am not sure
if stopping the
computation made also Bonmin detect an infeasible problem. If you have
a look at the
output the status is always "OPT" except at the last step.
In the code, at the end I make a check on the best solution but the
pointer must be
NULL. Do you think I am doing something wrong?
cheers,
g
******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear optimization.
Ipopt is released as open source code under the Common Public License (CPL).
For more information visit http://projects.coin-or.org/Ipopt
******************************************************************************
NOTE: You are using Ipopt by default with the MUMPS linear solver.
Other linear solvers might be more efficient (see Ipopt documentation).
Code:
//Set up done, now let's branch and bound
double time1 = CoinCpuTime();
double sol[VARSNUM];
try {
Bab bb;
bb(bonmin);//process parameter file using Ipopt and do branch and
bound using Cbc
if(bb.bestSolution()!=NULL){
for(i=0;i<VARSNUM;i++){
sol[i]=*(bb.bestSolution()+i);
printf("\n%f",sol[i]);
}
}
else{
printf("\n\n\tNo feasible solution!\n\n");
}
printf("\n");
}
catch(TNLPSolver::UnsolvedError *E) {
//There has been a failure to solve a problem with Ipopt.
std::cerr<<"Ipopt has failed to solve a problem"<<std::endl;
}
catch(OsiTMINLPInterface::SimpleError &E) {
std::cerr<<E.className()<<"::"<<E.methodName()
<<std::endl
<<E.message()<<std::endl;
}
catch(CoinError &E) {
std::cerr<<E.className()<<"::"<<E.methodName()
<<std::endl
<<E.message()<<std::endl;
}
return 0;
OUTPUT:
$ make clean ; make ;time ./CppExample
rm -rf CppExample MyBonmin.o MyTMINLP.o
g++ -g -O0 -fomit-frame-pointer -pipe -DNDEBUG -pedantic-errors
-Wimplicit -Wparentheses -Wreturn-type -Wcast-qual -Wall
-Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas
-I`echo /home/gaprea/usr/local/include/coin` -I`echo
/home/gaprea/usr/local/include/coin/ipopt` -c -o MyBonmin.o `test -f
'MyBonmin.cpp' || echo '/'`MyBonmin.cpp
MyBonmin.cpp: In function ‘int main(int, char**)’:
MyBonmin.cpp:239: warning: unused variable ‘time1’
g++ -g -O0 -fomit-frame-pointer -pipe -DNDEBUG -pedantic-errors
-Wimplicit -Wparentheses -Wreturn-type -Wcast-qual -Wall
-Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas
-I`echo /home/gaprea/usr/local/include/coin` -I`echo
/home/gaprea/usr/local/include/coin/ipopt` -c -o MyTMINLP.o `test -f
'MyTMINLP.cpp' || echo '/'`MyTMINLP.cpp
bla=;\
for file in MyBonmin.o MyTMINLP.o; do bla="$bla `echo $file`"; done; \
g++ -Wl,--rpath -Wl,/home/gaprea/usr/local/lib -g -O0
-fomit-frame-pointer -pipe -DNDEBUG -pedantic-errors -Wimplicit
-Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith
-Wwrite-strings -Wconversion -Wno-unknown-pragmas -o CppExample $bla
-L/home/gaprea/usr/local/lib -lbonmin -lipopt -lCbc -lCgl -lOsiClp
-lOsi -lClp -lCoinUtils
/home/gaprea/000_System_Biology/SOFTWARE/MINLP/Bonmin-1.0/build/ThirdParty/ASL/amplsolver.a
-ldl -lm `cat /home/gaprea/usr/local/lib/../share/doc/coin/Ipopt/ipopt_addlibs_cpp.txt`
`cat /home/gaprea/usr/local/lib/../share/doc/coin/Cgl/cgl_addlibs.txt`
`cat /home/gaprea/usr/local/lib/../share/doc/coin/Osi/osi_addlibs.txt`
`cat /home/gaprea/usr/local/lib/../share/doc/coin/Clp/clp_addlibs.txt`
`cat /home/gaprea/usr/local/lib/../share/doc/coin/CoinUtils/coinutils_addlibs.txt`
******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear optimization.
Ipopt is released as open source code under the Common Public License (CPL).
For more information visit http://projects.coin-or.org/Ipopt
******************************************************************************
NOTE: You are using Ipopt by default with the MUMPS linear solver.
Other linear solvers might be more efficient (see Ipopt documentation).
NLP0012I
Num Status Obj It time
NLP0013I 1 OPT -75.00000003473977 492 959.476
NLP0013I 2 OPT -75.00000003322431 574 580.888
NLP0013I 3 OPT -74.9999999873914 252 281.598
Cbc0010I After 0 nodes, 0 on tree, 1e+50 best solution, best possible
-75 (862.50 seconds)
NLP0013I 4 OPT -75.00000003322431 574 585.109
NLP0013I 5 OPT -75.00000003078493 461 733.662
NLP0013I 6 OPT -74.99999998744833 561 488.775
Cbc0020I Exiting on maximum time
Cbc0005I Partial search - best objective 1e+50 (best possible -75),
took 574 iterations and 1 nodes (2670.06 seconds)
Cbc0032I Strong branching done 2 times (1848 iterations), fathomed 0
nodes and fixed 0 variables
Cbc0035I Maximum depth 1, 0 variables fixed on reduced cost
NLP0013I 7 INFEAS -0.002498066137619087 92 52.9873
Problem status: 2
Objective value: 1e+50
No feasible solution!
real 77m15.847s
user 61m27.346s
sys 0m37.830s
More information about the Bonmin
mailing list