-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BONMIN options not working #53
Comments
It's my experience that options in Bonmin are terribly broken. I've had to go in and modify the source code on multiple occasions. https://github.com/mlubin/Pajarito.jl is a julia version of bonmin (and much more) that may be worth playing around with. |
Thanks @mlubin I have formulated the same problem in C callable library from BONMIN. The tolerances, no matter how I change them, stay at 1e-08 all the time. However, the MILP solver was set successfully(at least I saw some differnces in iterations and nodes). While I try to set subsolver for amplnlwriter, results are all the same. Do you think there is any mistake in the code? Thanks. |
95% chance that the issue is with Bonmin and not AmplNLWriter.
…On Fri, Nov 25, 2016 at 10:27 AM, Jo.WTF ***@***.***> wrote:
Thanks @mlubin <https://github.com/mlubin>
I have formulated the same problem in C callable library from BONMIN.
The tolerances, no matter how I change them, stay at 1e-08 all the time.
However, the MILP solver was set successfully(at least I saw some
differnces in iterations and nodes).
While I try to set subsolver for amplnlwriter, results are all the same.
Do you think there is any mistake in the code?
Thanks.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#53 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABp0M_K7RvaB9gox-pBCEglIcPPwiz2Nks5rBv5qgaJpZM4K8TwV>
.
|
It's not clear to me from your description, but have you also tried setting the options using the |
I firstly tried to set options using command line, it didnt work so I then used the bonmin.opt file as you linked. But it seems they didnt work anyway. |
Okay, then Miles is almost certainly correct that it is Bonmin itself causing the problem |
While my question is: I tried to do the same set ups in BONMIN C library, it did work...Why's that? Even if that's Bonmin's problem, is there any work around? |
@JO-WTF, look into Bonmin's code for interfacing with the AMPL solver interface. The code path for options when reading .nl files is likely different from the path for options passed through the C interface. |
I have put the opt file in the directory of my julia file. It was successfully read and some options have been applied but some are not. |
Hi Guys, I have done some more test and got some results. Thought you might be interested in it: I wrote a model in AMPL and converted it into .nl file, then I use bonmin to solve the .nl file with options "bonmin.milp_solver Cbc_D" and "bonmin.milp_solver Cplex" respectively. The model was solved successfully but because sub-solvers are different, they took different numbers of iterations and time. Then I wrote the same model in Julia, using AmplNLWriter to call BONMIN to solve it. Although I have used the same bonmin.opt file to set the sub-solver to Cplex, the results showing it was solved by Cbc_D (number of iterations and every output were exactly the same with the one solved the BONMIN+Cbc_D). That means: the option file had no problem; Any idea please? Thanks. |
It is working for me if I create the julia> include("examples/jump_minlp.jl")
> example: jump_minlp
Bonmin 1.8.4 using Cbc 2.9.7 and Ipopt 3.12.4
bonmin:
******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear optimization.
Ipopt is released as open source code under the Eclipse Public License (EPL).
For more information visit http://projects.coin-or.org/Ipopt
******************************************************************************
NLP0012I
Num Status Obj It time Location
NLP0014I 1 OPT 0.75928418 9 0.005656
NLP0014I 2 OPT 9.9999996 9 0.004086
NLP0012I
Num Status Obj It time Location
NLP0014I 1 OPT 9.9999996 9 0.003783
Cbc0012I Integer solution of 9.9999996 found by FPump after 0 iterations and 0 nodes (0.02 seconds)
NLP0014I 2 OPT 5.1713201 11 0.005914
NLP0014I 3 OPT 6.0097585 7 0.003296
NLP0014I 4 OPT 3.8208866 10 0.004227
NLP0014I 5 OPT 7.0927311 8 0.003684
Cbc0010I After 0 nodes, 1 on tree, 9.9999996 best solution, best possible 0.75928418 (0.04 seconds)
NLP0014I 6 OPT 5.1713201 11 0.005483
NLP0014I 7 OPT 6.0097585 7 0.003182
NLP0014I 2 OPT 6.0097587 8 0.003789
Cbc0004I Integer solution of 6.0097587 found after 18 iterations and 2 nodes (0.05 seconds)
NLP0014I 8 OPT 7.0927314 8 0.004916
NLP0014I 9 OPT 9.9999995 8 0.00535
Cbc0001I Search completed - best objective 6.009758719300063, took 34 iterations and 4 nodes (0.06 seconds)
Cbc0032I Strong branching done 2 times (36 iterations), fathomed 0 nodes and fixed 0 variables
Cbc0035I Maximum depth 1, 0 variables fixed on reduced cost
"Finished"
Success :: (line:507) :: fact was true
Expression: getobjectivevalue(m) --> roughly(6.00975,1.0e-5)
Expected: 6.00975
Occurred: 6.00975878926541 shell> echo "milp_solver cplex" > bonmin.opt julia> include("examples/jump_minlp.jl")
> example: jump_minlp
Bonmin 1.8.4 using Cbc 2.9.7 and Ipopt 3.12.4
bonmin:
WARNING: Variable value not defined for component of x. Check that the model was properly solved.
WARNING: Variable value not defined for entry of y. Check that the model was properly solved.
Failure :: (line:507) :: fact was false
Expression: getobjectivevalue(m) --> roughly(6.00975,1.0e-5)
Expected: 0 ≅ 6.00975 I don't have bonmin set up to use cplex, so it doesn't solve, but this is indication that the option file is being respected. Can you try using the same approach to check it works? |
Also for what it's worth, this package does nothing more than create the .nl file from the JuMP model and then use your specified solver to solve the .nl file, exactly as you would have done for solving the .nl file created by AMPL. There is no reason the options behavior should be different between these two approaches. |
I have just tried to modify the code and it seems to be working now. Originally I set up BONMIN as: solver = BonminNLSolver() And it didn't work. Then I changed to: solver = AmplNLSolver("bonmin") and options now are working. Not sure why tho. |
Closing as this doesn't appear to be an AmplNLWriter issue. |
In the solution given by the solver above, some variables are set to 1.0e-8 instead of 0. Because of the nature of this problem, precision of 1.0e-8 is far from enough for us. So I tried to set BONMIN options including:
However, they didn't affect the result at all.
I also tried to set:
bonmin.milp_solver Cplex
However, the result&output were exactly the same with Cbc_D.
So I think some options are not taking effect.
odow: formatting
The text was updated successfully, but these errors were encountered: