Problem with Solver (CPLEX vs Minos & FortMP)

1,136 views
Skip to first unread message

Sammy Anglelesco

unread,
Feb 7, 2012, 7:45:53 AM2/7/12
to AMPL Modeling Language
I wonder if someone might be able to assist me . . .

I have a problem which seems to solve when I use Minos or FortMP -
however, when I use CPlex, I get the following error message:

solve_result = '?'
solve_message = ''

Any insight as to what this means, and why this might only occur when
using CPlex and not the others?

Thank you!

Sammy

Robert Fourer

unread,
Feb 7, 2012, 11:41:15 AM2/7/12
to am...@googlegroups.com
MINOS is a solver for linear & nonlinear problems in continuous variables;
CPLEX and FortMP are for linear & convex quadratic problems in continuous
and/or integer variables. So your choice must depend on the kind of problem
that you're trying to solve. (All of them can be applied to linear programs
in continuous variables.)

A solve_result = '?' and solve_message = '' indicates that CPLEX did not run
at all. For example it might not be installed on your system or might not
have a proper license. Your supplier for CPLEX should be able to help you
with this.

Bob Fourer
4...@ampl.com

Sammy

unread,
Feb 8, 2012, 6:05:12 AM2/8/12
to AMPL Modeling Language
Thank you for the reply!

I checked my AMPL folder, and have found copies of cplex.exe as well
as the cplex.dll - which means that they are present. Could there
maybe be an issue of me needing to load it properly in AMPL?

Robert Fourer

unread,
Feb 8, 2012, 1:04:14 PM2/8/12
to am...@googlegroups.com
In command-line AMPL, there is no special loading of CPLEX. You just
specify "option solver cplex;" and then "solve;". AMPL looks for cplex.exe
in the current folder and the current search path. After the solve you
should get some messages from CPLEX, or some error messages if it does not
run properly.

Since you have FortMP, perhaps you are using AMPL Studio, which may hide
some of what is happening. If this is the case, try typing "option solver
cplex;" and "solve;" in the command entry window at the bottom, rather than
using the menus or buttons, and see what response you get.

In any case you should post AMPL's output, particularly after the "solve".
Also the responses to the command "option version;" and "shell 'cplex -v';"
would useful as they establish what versions you are using.

Sammy

unread,
Feb 8, 2012, 3:49:07 PM2/8/12
to AMPL Modeling Language
Correct - I am using AMPL Studio.

Tried running it through the command line in studio and got the
following message:

option solver cplex;
file -
line 5
offset 20
syntax error
-
solve;
Cannot invoke cplex: no such program.
#execute 0 0 153653736
- option solver cplex;

Robert Fourer

unread,
Feb 9, 2012, 12:06:13 PM2/9/12
to am...@googlegroups.com
It seems that cplex.exe has not been placed in a folder where AMPL can find
it. Is it in the same folder as minos.exe and fortmp.exe? If not then you
may need to copy it there, along with the cplex dll file if there is one for
your installation.

You may want to contact the developers of AMPL Studio, who are the experts
on how it sets up the AMPL and solver files. Their contact is
tech-s...@optirisk-systems.com.

mou

unread,
Dec 23, 2017, 5:19:21 AM12/23/17
to AMPL Modeling Language
I have the same optimal solution in MINOS and CPLEX. But the variable values differ. Do i have got an alternative solution? after solving the problem by minos, i've called cplex to solve its sensitivity analysis. i used command presolve. but dont get any output for this. 
if i solve problem by cplex at first and then call for sensitivity it shows the result. what's the problem?
what does it mean (2 phase 1) ?

Robert Fourer

unread,
Dec 27, 2017, 11:34:40 AM12/27/17
to am...@googlegroups.com
If MINOS and CPLEX show the same optimal value for the objective function, then it is normal that the variable values may differ. In that case MINOS and CPLEX have found two alternative optimal solutions.

It's not clear from the information that you give, why you don't get a proper sensitivity analysis when you solve with MINOS and then with CPLEX. Can you provide some example files that we can use to reproduce this behavior on our computers?

In simplex methods, phase 1 finds a feasible solution, and then phase 2 finds an optimal solution.

Bob Fourer
am...@googlegroups.com

=======

From: am...@googlegroups.com [mailto:am...@googlegroups.com] On Behalf Of mou
Sent: Saturday, December 23, 2017 1:27 PM
To: AMPL Modeling Language

Nusrat Tabassum

unread,
Jan 16, 2018, 1:43:29 PM1/16/18
to am...@googlegroups.com
Thank you.. for your help

Virus-free. www.avast.com

--
You received this message because you are subscribed to a topic in the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ampl/e3CmV1e3b4w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ampl+unsubscribe@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages