Skip to content

Commit

Permalink
Merge pull request #88 from cvanaret/filterslp_preset
Browse files Browse the repository at this point in the history
Added filterslp preset
  • Loading branch information
cvanaret authored Nov 14, 2024
2 parents 1191b41 + 070eba7 commit b63a5c3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Uno implements the following strategies:

**Any strategy combination** can be automatically generated without any programming effort from the user. Note that all combinations do not necessarily result in sensible algorithms, or even convergent approaches. For more details, check out our [preprint](https://www.researchgate.net/publication/381522383_Unifying_nonlinearly_constrained_nonconvex_optimization) or my [presentation at the ICCOPT 2022 conference](https://www.researchgate.net/publication/362254109).

Uno implements three **presets**, that is strategy combinations that correspond to existing solvers (as well as hyperparameter values found in their documentations):
Uno implements **presets**, that is strategy combinations that correspond to existing solvers (as well as hyperparameter values found in their documentations):
* `filtersqp` mimics filterSQP (trust-region feasibility restoration filter SQP method);
* `ipopt` mimics IPOPT (line-search feasibility restoration filter barrier method);
* `byrd` mimics Byrd's S $\ell_1$ QP (line-search $\ell_1$ merit S $\ell_1$ QP method).
Expand Down
23 changes: 23 additions & 0 deletions uno/options/Presets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <stdexcept>
#include "Presets.hpp"
#include "Options.hpp"
#include "solvers/LPSolverFactory.hpp"
#include "solvers/QPSolverFactory.hpp"
#include "solvers/SymmetricIndefiniteLinearSolverFactory.hpp"

Expand All @@ -19,13 +20,17 @@ namespace uno {
/** default preset **/
const auto QP_solvers = QPSolverFactory::available_solvers();
const auto linear_solvers = SymmetricIndefiniteLinearSolverFactory::available_solvers();
const auto LP_solvers = LPSolverFactory::available_solvers();

if (not QP_solvers.empty()) {
Presets::set(options, "filtersqp");
}
else if (not linear_solvers.empty()) {
Presets::set(options, "ipopt");
}
else if (not LP_solvers.empty()) {
Presets::set(options, "filterslp");
}
// note: byrd is not very robust and is not considered as a default preset
}
return options;
Expand Down Expand Up @@ -125,6 +130,24 @@ namespace uno {
options["funnel_switching_infeasibility_exponent"] = "2";
options["funnel_update_strategy"] = "2";
}
else if (preset_name == "filterslp") {
options["constraint_relaxation_strategy"] = "feasibility_restoration";
options["subproblem"] = "LP";
options["globalization_mechanism"] = "TR";
options["globalization_strategy"] = "fletcher_filter_method";
options["filter_type"] = "standard";
options["progress_norm"] = "L1";
options["residual_norm"] = "L2";
options["sparse_format"] = "CSC";
options["TR_radius"] = "10";
options["l1_constraint_violation_coefficient"] = "1.";
options["enforce_linear_constraints"] = "yes";
options["tolerance"] = "1e-5";
options["loose_tolerance"] = "1e-4";
options["TR_min_radius"] = "1e-8";
options["switch_to_optimality_requires_linearized_feasibility"] = "yes";
options["protect_actual_reduction_against_roundoff"] = "no";
}
else {
throw std::runtime_error("The preset " + preset_name + " is not known");
}
Expand Down

0 comments on commit b63a5c3

Please sign in to comment.