5.1 Presolving in AMPL
To assess AMPL’s presolving performance, we gathered presolving characteristics while performing the model instance creation time benchmark. We have used 286 models that were successfully converted from GAMS original model to the AMPL scalar model.
Table 7
AMPL model presolving.
Type |
# models |
# infeasible |
Presolved (%) |
Constraints reduced (%) |
Variables reduced (%) |
CNS |
4 |
0 |
100.00% |
14.63% |
31.39% |
DNLP |
5 |
0 |
20.00% |
0.00% |
7.41% |
LP |
57 |
0 |
36.84% |
17.81% |
9.66% |
MCP |
19 |
0 |
89.47% |
47.00% |
8.56% |
MINLP |
21 |
1 |
61.90% |
16.32% |
9.30% |
MIP |
61 |
0 |
60.66% |
19.06% |
11.50% |
MIQCP |
5 |
2 |
60.00% |
0.00% |
2.38% |
MPEC |
1 |
0 |
100.00% |
50.00% |
0.00% |
NLP |
101 |
2 |
47.52% |
9.71% |
11.55% |
QCP |
10 |
0 |
60.00% |
7.10% |
2.55% |
RMIQCP |
2 |
0 |
0.00% |
0.00% |
0.00% |
Total |
286 |
5 |
52.80% |
18.42% |
10.73% |
A detailed report of the presolving applied to the specific model can be seen in the benchmark section of our GitHub repository (Jusevičius and Paulavičius,
2019), while the summary of it can be found in Table
7. We observed that
AMPL presolver managed to simplify the models in 52.8% of the cases, out of which 5 times it could determine that the problem solution is not feasible, thus not even requiring to call the solver. On average, once applied, the
AMPL presolver managed to reduce the model size by removing 18.42% of constraints and 10.73% of variables.
We can conclude that AMPL presolver is an efficient way to simplify larger problems, leading to improved solution finding performance once invoking a solver with an already reduced problem model instance. Moreover, determining not feasible models can help modellers debug the problem definition process and find errors in the model definition. This allows us to argue that presolving is an important capability of any modern AML.
5.2 Presolve Impact on Solving
To evaluate if
AMPL presolving has a positive impact on problem-solving, an additional benchmark was conducted. The benchmark included 146 out of 151 models to which
AMPL has applied presolve in the model instance creation benchmark. Five models that
AMPL presolve determined to be not feasible were excluded from the benchmark. Shell script
solve-benchmark.sh provided in the tools directory of our GitHub repository (Jusevičius and Paulavičius,
2019) was created for executing such a benchmark. The script solves each model using one of the solvers and gathers output statistics to a report file.
We have chosen to solve the models using Gurobi and BARON solvers. Gurobi Optimizer (v.8.1.0) was chosen for solving LP, MIP, QCP, and MIQCP type of problems. At the same time, BARON (v.18.11.12) global solver was chosen for solving NLP, MINLP, MCP, MPEC, CNS, and DNLP problems. The solvers’ choice was motivated by the support for particular problem types. and the popularity of solvers based on NEOS Server statistics. Two attempts to solve each model were made. One with AMPL presolver turned on (default setting), and the second one with AMPL presolver turned off. After each run, solvers statistics, including iterations count, solve time (pure solve phase execution time), and objective, were gathered.
It is important to note that both
BARON and
Gurobi solvers have their presolve mechanisms (Puranik and Sahinidis,
2017; Achterberg
et al.,
2019). Thus the provided model is simplified by the solver too. This might result in very similar models being solved by the solver despite the
AMPL presolve being turned on or off. However, the focus was on estimating
AMPL presolve impact in real-life situations; therefore, a full benchmark was executed without changing the default solver behaviour. Later on, an additional benchmark was made to estimate the impact of
AMPL presolve once solver presolve functionality is turned off.
Detailed
AMPL presolve impact on solving report can be found in our GitHub repository’s (Jusevičius and Paulavičius,
2019) file
ampl-solving-times.xlsx sheet Benchmark 1. Table
8 summarizes the positive and negative impact
AMPL presolve had on solving the problems iteration and time-wise. Positive impact means fewer iterations or time was needed to solve a problem once the presolve was turned on. A negative impact means the opposite that more iterations or time was required. The impact is considered neutral if the number of iterations did not change or the required time was within the one-second tolerance level.
Table 8
Summary of AMPL presolve impact on solving.
|
Iteration-wise |
Time-wise |
Iteration-wise (%) |
Time-wise (%) |
Positive |
37 |
67 |
26.43% |
47.86% |
Neutral |
74 |
40 |
52.86% |
28.57% |
Negative |
29 |
33 |
20.71% |
23.57% |
During this benchmark, 6 models failed to be solved due to solver limitations. Two models were deemed to be not feasible, and two were solved during the AMPL presolve phase. Solvers were capable of solving 41 models during the solver’s presolve phase. Moreover, for six models, the mismatching objective was found with AMPL presolve turned on and off. Overall, AMPL presolve positively impacted 26.43% of the cases iteration-wise and 47.86% time-wise. However, it hurt 20.71% of cases iteration-wise and 23.57% time-wise.
As mentioned earlier, both
BARON and
Gurobi solvers have their presolve mechanisms. An additional benchmark was made to test the impact of
AMPL presolve with disabled solvers presolving. Since only
Gurobi allows the user to disable presolve functionality, a subset of models previously solved with
Gurobi was chosen. Detailed benchmark results can be seen in our GitHub repository’s (Jusevičius and Paulavičius,
2019) file
ampl-solving-times.xlsx sheet
Benchmark 2. The summary of the benchmark is provided in Tables
9,
10.
Gurobi could not solve two
MIP problems (
clad and
mws) in a reasonable time once
Gurobi’s presolve functionality was turned off. Those models were excluded from the benchmark.
Table 9
AMPL presolve impact with Gurobi presolve on.
|
Iteration-wise |
Time-wise |
Iteration-wise (%) |
Time-wise (%) |
Positive |
18 |
39 |
28.57% |
61.90% |
Neutral |
34 |
0 |
53.97% |
0.00% |
Negative |
11 |
24 |
17.46% |
38.10% |
Table 10
AMPL presolve impact with Gurobi presolve off.
|
Iteration-wise |
Time-wise |
Iteration-wise (%) |
Time-wise (%) |
Positive |
33 |
44 |
54.10% |
72.13% |
Neutral |
10 |
0 |
16.39% |
0.00% |
Negative |
18 |
17 |
29.51% |
27.87% |
As seen once comparing these results in Tables
9 and
10, the AMPL presolve had a greater positive effect both iteration-wise (+25.5%) and time-wise (+10.2%) once Gurobi presolve was turned off. AMPL presolve also had a less neutral impact once the solver presolving was off, thus leading to the conclusion that during the first benchmark, some models were simplified to very similar ones before actually solving them.
As we can see from the benchmarks, presolving done by AML has inconclusive effects on the actual problem solving both iterations and time-wise. However, a positive impact is always more significant than the negative one, and it especially becomes evident once the solver does not have or use its problem presolving mechanisms. This allows us to conclude that the presolving capability of AML is an important feature of a modern algebraic modelling language. We can also advise choosing AML having presolving capabilities in cases the solver used to solve the problem does not have its presolving mechanism.