Loop Issue with presolving

14 views
Skip to first unread message

Pratim Vakish

unread,
Nov 15, 2017, 1:19:46 PM11/15/17
to am...@googlegroups.com

Hello,


I am trying to solve a series of optimization problems. It is modelled with a "for" loop.

I have a termination criterion which stipulates that the loop should stop as soon as the incumbent problem is feasible. This is modelled with the following AMPL command: 

if DECOMPO.result = "solved" then break;

(DECOMPO is the name of the problem)


If the incumbent problem is infeasible, I want to move to the next problem.



The problem is that some problems are detecting infeasible through the preprocessing done by AMPL (not by the solver). And the loop terminates.

That is not what I want to have. If preprocessing finds the problem infeasible, I would like instead to consider the next problem in the list.


How can I code that in AMPL.I pasted below a summary of my current AMPL commands.


for{j in 1..r} {

option solver cplex;
solve DECOMPO > NPD1-DEC_out.txt;
if DECOMPO.result = "solved" then break;
}




Robert Fourer

unread,
Nov 16, 2017, 8:51:42 PM11/16/17
to am...@googlegroups.com
AMPL has the following default settings:

option presolve_warnings 5;
option eexit -10;

The first means that each solve will display up to 5 presolve infeasibility warnings, and the second means that the loop will be aborted when the total number of infeasibility warnings reaches 10. (If eexit is set to +10 then the whole AMPL session is aborted when the number reaches 10.)

Thus if you want to prevent the loop from being aborted, you have two choices. You can set "option presolve_warnings 0;" to prevent presolve from displaying any infeasibility warnings, or you can set "option eexit -100000;" so that the limit on presolve infeasibility warnings is never reached. The attached example shows how this works.

Bob Fourer
am...@googlegroups.com

=======
diet.mod
diet.dat
diet.run
Reply all
Reply to author
Forward
0 new messages