CRAN Task View: Optimization and Mathematical Programming

Maintainer:Florian Schwendinger, Hans W. Borchers
Contact:R-optimization at
Contributions:Suggestions and improvements for this task view are very welcome and can be made through issues or pull requests on GitHub or via e-mail to the maintainer address. For further details see the Contributing guide.
Citation:Florian Schwendinger, Hans W. Borchers (2024). CRAN Task View: Optimization and Mathematical Programming. Version 2024-07-05. URL
Installation:The packages from this task view can be installed automatically using the ctv package. For example, ctv::install.views("Optimization", coreOnly = TRUE) installs all the core packages or ctv::update.views("Optimization") installs all packages that are not yet installed and up-to-date. See the CRAN Task View Initiative for more details.

This CRAN Task View contains a list of packages that offer facilities for solving optimization problems. Although every regression model in statistics solves an optimization problem, they are not part of this view. If you are looking for regression methods, the following views will also contain useful starting points: MachineLearning, Econometrics, Robust Packages are categorized according to the following sections. See also the “Related Links” and “Other Resources” sections at the end.


Many packages provide functionality for more than one of the subjects listed at the end of this task view. E.g., mixed integer linear programming solvers typically offer standard linear programming routines like the simplex algorithm. Therefore following each package description a list of abbreviations describes the typical features of the optimizer (i.e., the problems which can be solved). The full names of the abbreviations given in square brackets can be found at the end of this task view under Classification According to Subject.

If you think that some package is missing from the list, please contact the maintainer via e-mail or submit an issue or pull request in the GitHub repository linked above.

Optimization Infrastructure Packages

General Purpose Continuous Solvers

Package stats offers several general purpose optimization routines. For one-dimensional unconstrained function optimization there is optimize() which searches an interval for a minimum or maximum. Function optim() provides an implementation of the Broyden-Fletcher-Goldfarb-Shanno (BFGS) method, bounded BFGS, conjugate gradient (CG), Nelder-Mead, and simulated annealing (SANN) optimization methods. It utilizes gradients if provided, for faster convergence. Typically it is used for unconstrained optimization but includes an option for box-constrained optimization.

Additionally, for minimizing a function subject to linear inequality constraints, stats contains the routine constrOptim(). Then there is nlm which is used for solving nonlinear unconstrained minimization problems. nlminb() offers box-constrained optimization using the PORT routines. [RGA, QN]

Quadratic Optimization

Test and Benchmarking Collections

Least-Squares Problems

Function solve.qr() (resp. qr.solve()) handles over- and under-determined systems of linear equations, returning least-squares solutions if possible. And package stats provides nls() to determine least-squares estimates of the parameters of a nonlinear model. nls2 enhances function nls() with brute force or grid-based searches, to avoid being dependent on starting parameters or getting stuck in local solutions.

Semidefinite and Convex Solvers

Global and Stochastic Optimization

Mathematical Programming Solvers

This section provides an overview of open source as well as commercial optimizers. Which type of mathematical programming problem can be solved by a certain package or function can be seen from the abbreviations in square brackets. For a Classification According to Subject see the list at the end of this task view.

Interfaces to Open Source Optimizers

Interfaces to Commercial Optimizers

This section surveys interfaces to commercial solvers. Typically, the corresponding libraries have to be installed separately.

Some more commercial companies, e.g. ‘LocalSolver’, ‘Artelys Knitro’, or ‘FICO Xpress Optimization’, have R interfaces that are installed while the software gets installed. Trial licenses are available, see the corresponding websites for more information.

Combinatorial Optimization

Multi Objective Optimization

Specific Applications in Optimization

Classification According to Subject

What follows is an attempt to provide a by-subject overview of packages. The full name of the subject as well as the corresponding MSC 2010 code (if available) are given in brackets.

CRAN packages

Core:alabama, DEoptim, dfoptim, quadprog, ucminf.
Regular:ABCoptim, adagio, ao, BB, boot, bvls, calibrar, caRamel, cccp, CEoptim, clarabel, clue, cmaes, cmaesr, colf, coneproj, copulaedas, crs, CVXR, dclone, DEoptimR, desirability, Dykstra, ECOSolveR, ecr, emoa, flacco, GA, gafit, genalg, GenSA, globalOptTests, glpkAPI, GPareto, graDiEnt, gsl, gslnls, highs, igraph, irace, isotone, kernlab, kofnGA, lbfgs, lbfgsb3c, limSolve, linprog, LowRankQP, lpSolve, lpSolveAPI, lsei, ManifoldOptim, MaOEA, marqLevAlg, matchingMarkets, matchingR, maxLik, mcga, mco, metaheuristicOpt, minpack.lm, minqa, mixsqp, mize, mknapsack, mlrMBO, n1qn1, neighbours, neldermead, nilde, NlcOptim, nloptr, nls2, nlsic, nlsr, NMOF, nnls,, nspmix, ompr, onls, OOR, optimizeR, optimParallel, optimsimplex, optimx, optmatch, osqp, parma, piqp, pso, psoptim, psqn, qap, qpmadr, quadprogXT, quantreg, rBayesianOptimization, rcdd, RCEIM, rCMA, Rcplex, RcppDE, RcppNumerical, Rcsdp, Rdsdp, REBayes, rgenoud, Rglpk, Rmalschains, rminizinc, rmoo, Rmosek, rneos, ROI, ROI.plugin.neos, ROI.plugin.qpoases, roptim, Rsolnp, Rsymphony, scs, sdpt3r, smoof, sna, soma, stochQN, subplex, tabuSearch, TreeDist, trust, trustOptim, TSP.

Related links

Other resources