AMPL versus Basic Language (C++/JAVA/Python) integrated with solver (CPLEX, GUROBI)

386 views
Skip to first unread message

Cheng-Lung Chen

unread,
Jul 30, 2016, 12:39:47 AM7/30/16
to AMPL Modeling Language
Hi 

I use AMPL for a quite long time. I found it is very powerful in so many ways, include design some MIP-based heuristic, adding user cut, coding decomposition algorithms and separation problems. What I don't understand is why some professor still claim AMPL has certain limitations(I heard a professor said that AMPL can not do Lagrangian relaxation, but it actually can.)  They prefer their PhD students to use basic language to code everything and use the solver library. 

This question might sound stupid, but I still wanna ask, in what condition using C++ with CPLEX is better than using AMPL? I know it must be more flexible, but suppose we are talking about these common optimization problem, is there any reason we have to use complicated option (C++) than easier option (AMPL) ?

Any opinion is welcomed. Thank you. 

Robert Fourer

unread,
Jul 31, 2016, 1:43:39 PM7/31/16
to am...@googlegroups.com
The C++ interface to CPLEX can be useful when you need detailed low-level control of the solver, such as when you want to influence the MIP search through callbacks, or you want to solve a very large number of small problems that are almost the same. If AMPL works for your application, however, then I cannot see any advantage in using C++, and there is the disadvantage that the C++ interface is a lot more difficult to deal with.

You might want to do some data preparation and solution analysis in C++, while formulating the model in AMPL, but for that situation you can use the C++ interface to AMPL (http://ampl.com/products/api/) along with the AMPL interface to CPLEX or whatever solver you like.

Bob Fourer
am...@googlegroups.com

=======

Cheng-Lung Chen

unread,
Jul 31, 2016, 7:36:37 PM7/31/16
to AMPL Modeling Language
Thank you Dr. Fourer. 

Cheng-Lung Chen於 2016年7月30日星期六 UTC-4上午12時39分47秒寫道:
Reply all
Reply to author
Forward
0 new messages