El0ps: An Exact L0-Problem Solver


el0ps is a Python package providing utilities to handle L0-regularized problems expressed as

\[\textstyle\min_{\mathbf{x} \in \mathbb{R}^{n}} f(\mathbf{Ax}) + \lambda\|\mathbf{x}\|_0 + h(\mathbf{x})\]

appearing in several applications. These problems aim at minimizing a trade-off between a data-fidelity function \(f\) composed with a matrix \(\mathbf{A} \in \mathbb{R}^{m \times n}\) and the L0-norm which counts the number of non-zeros in its argument to promote sparse solutions. The additional penalty function \(h\) can be used to enforce other desirable properties on the solutions and is involved in the construction of efficient solution methods. The package includes:

  • A flexible framework with built-in problem instances and the possibility to define custom ones,

  • A state-of-the-art solver based on a specialized Branch-and-Bound algorithm,

  • An interface to scikit-learn providing linear model estimators based on L0-regularized problems.

Get a quick tour of the package with the Getting started page.

Installation

el0ps is available on pypi. The latest version of the package can be installed as follows:

pip install el0ps

Contribute

Feel free to contribute by report any bug on the issue page or by opening a pull request. Any feedback or contribution is welcome. Check out the Contribute page for more information.

Cite

el0ps is distributed under AGPL v3 license.

Please cite the package as follows:

@article{guyard2025el0ps,
   title           = {El0ps: An Exact L0-regularized Problems Solver},
   author          = {Théo Guyard and Cédric Herzet and Clément Elvira},
   year            = {2025},
   eprint          = {2506.06373},
   archivePrefix   = {arXiv},
}

Please cite the Branch-and-Bound solver included in the package as follows:

@article{elvira2025generic,
   title           = {A Generic Branch-and-Bound Algorithm for $\ell_0$-Penalized Problems with Supplementary Material},
   author          = {Clément Elvira and Théo Guyard and Cédric Herzet},
   year            = {2025},
   eprint          = {2506.03974},
   archivePrefix   = {arXiv},
}