el0ps.solver.OaSolver¶
- class el0ps.solver.OaSolver(optimizer_name='gurobi', relative_gap=1e-08, absolute_gap=0.0, time_limit=None, iter_limit=None, inner_iter_limit=None, inner_rel_tol=1e-08, verbose=False, keeptrace=False)¶
Outer approximation solver for L0-regularized problems.
The problem is expressed as
\[\textstyle\min_{\mathbf{x} \in \mathbb{R}^{n}} f(\mathbf{Ax}) + \lambda\|\mathbf{x}\|_0 + h(\mathbf{x})\]where \(f\) is a
el0ps.datafit.BaseDatafit
function, \(\mathbf{A} \in \mathbb{R}^{m \times n}\) is a matrix, \(h\) is ael0ps.penalty.BasePenalty
function, and \(\lambda\) is a positive scalar. This method is based on the work presented in “A unified approach to mixed-integer optimization problems with logical constraints” by D. Bertsimas et al. To use this solver, the optimizer specified in theoptimizer_name
parameter must be installed and accessible by pyomo which is the underlying library used to model the outer problem.- Parameters:
- optimizer_name: str = “gurobi”
Mixed-Integer Programming optimizer to use in the outer step. Available options are “cplex”, “gurobi”, and “mosek”.
- relative_gap: float, default=1e-8
Relative tolerance on the objective value.
- absolute_gap: float, default=0.0
Absolute tolerance on the objective value.
- time_limit: float, default=None
Limit in second on the solving time.
- iter_limit: int, default=None
Limit on the number of outer-approximation steps performed.
- inner_iter_limit: int, default=None
Maximum number of iterations for the inner steps optimization solver.
- inner_rel_tol: float, default=1e-8
Relative tolerance on the objective value for the inner steps.
- verbose: bool, default=False
Whether to toggle solver verbosity.
- keeptrace: bool, default=False
Whether to store the solver trace.
- __init__(optimizer_name='gurobi', relative_gap=1e-08, absolute_gap=0.0, time_limit=None, iter_limit=None, inner_iter_limit=None, inner_rel_tol=1e-08, verbose=False, keeptrace=False)¶
Methods
__init__
([optimizer_name, relative_gap, ...])add_cut
(optim, model, z, f, g)build_model
()can_continue
()initialize_inner_solver
()initialize_optimizer
()inner_solve
(z)outer_solve
(optim, model)print_footer
()print_header
()print_progress
()solve
(datafit, penalty, A, lmbd[, x_init])Solve an L0-regularized problem.
update_bounds
(zk, vk, xk, fk)update_trace
()Attributes
abs_gap
accept_jitclass
Return whether if the solver accepts a jitclass for the datafit and penalty function.
rel_gap
timer