This CRAN task view contains a list of packages which offer
facilities for solving optimization problems.
Although every regression model in statistcs solves an optimization
problem they are not part of this view. If you are looking for regression
methods, the following views will contain useful starting points:
Multivariate,
SocialSciences,
Robust
among others.
The focus of this task view is on
General Purpose Continuous
Solvers
,
Mathematical
Programming Solvers
and
Specific
Applications in Optimization
. Packages are categorized in these
three sections.
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
let me know.
-
Package stats offers several general purpose optimization
routines.
First, function
optim()
provides an implementation of
the Broyden-Fletcher-Goldfarb-Shanno (BFGS) method,
bounded BFGS, conjugate gradient, 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().
For one-dimensional unconstrained function optimization there is
optimize()
which searches an interval
for a minimum or maximum.
Then there is
nlm
which is used for solving nonlinear
unconstrained minimization problems. Eventually,
nlminb()
offers unconstrained and constrained
optimization using PORT routines. [RGA, QN]
-
clue
contains the function
sumt()
for
solving constrained optimization problems via the sequential
unconstrained minimization technique (SUMT).
-
Package
gsl
provides BFGS, conjugate gradient,
steepest descent, and Nelder-Mead algorithms. It uses a "line
search" approach via the function
multimin(). It is
based on the GNU Scientific Library (GSL). [RGA, QN]
-
Package
maxLik
provides a general purpose
Newton-Raphson optimizer
maxNR()
as well as wrapper
to methods, implemented in
optim(). It supports fitting a
submodel by specifying constant parameters.
-
subplex
provides unconstrained function
optimization based on a subspace searching simplex method.
-
Package
ucminf
implements an algorithm of
quasi-Newtonian type for nonlinear unconstrained
optimization. [QN]
-
In package
trust, a routine with the same name offers
local optimization based on the "trust region" approach.
-
Package
nleqslv
provides a
function
nleqslv()
implementing Newton and Broyden
methods with line search and trust region global strategies for
solving medium sized system of nonlinear equations.
-
In package
gafit
gafit()
uses a
genetic algorithm approach to find
the minimum of a one-dimensional function.
-
Package
genalg
contains
rbga(), an implementation of a genetic algorithm for
multi-dimensional function optimization.
-
Package
rgenoud
offers
genoud(), a routine which is capable of solving
complex function minimization/maximization problems by combining
evolutionary algorithms with
a derivative-based (quasi-Newtonian) approach.
-
Package
DEoptim
provides a global optimizer based
on the differential evolution algorithm.
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 by subject
see
the list at the end of this task view.
-
Package
linprog
solves linear programming problems using
the function
solveLP()
(the solver is based on
lpSolve) and can read model files in MPS
format. [LP]
-
In package
quadprog
solve.QP()
solves
quadratic programming problems
with linear equality and inequality constraints. [QP]
-
BB
contains the function
spg()
providing a
spectral projected gradient method for large scale optimization with
simple constraints. It takes a nonlinear objective function as an
argument as well as basic constraints. Furthermore,
BB
contains two functions (
dfsane()
and
sane()) for using the spectral gradient method
for solving a nonlinear system of equations.
-
In the
boot
package there is a routine called
simplex()
which realizes the two-phase tableau simplex
method for (relatively small) linear programming problems. [LP]
-
kernlab
contains the function
ipop
for
solving quadratic programming problems using interior point
methods. [IPM, QP]
-
limSolve
offers to solve linear or quadratic
optimization functions. [LP, QP]
-
LowRankQP
primal/dual interior point method solving
quadratic programming problems [IPM, QP]
-
Package
rcdd
offers the function
lpcdd()
for solving linear programs with exact arithmetic using the
GNU Multiple Precision (GMP)
library. [LP]
-
In package
Rdonlp2
function
donlp2(), a wrapper for the DONLP2
solver, offers the minimization of smooth nonlinear functions and
constraints. DONLP2 can be used freely for any kind of research
purposes, otherwise it requires licensing. [GO, NLP]
-
Rsolnp is currently being developed on
R-Forge
in project
rino. This package offers general nonlinear
optimization using the augmented lagrange multiplier method. [NLP]
Interfaces to Open Source Optimizers
-
Package
lpSolve
contains the routine
lp()
to solve LPs and MILPs by calling the freely
available solver
lp_solve
. This solver is
based on the revised simplex method and a branch-and-bound (B&B)
approach. It supports semi-continuous variables and Special Ordered
Sets (SOS). Furthermore
lp.assign()
and
lp.transport()
are aimed at solving assignment problems
and transportation problems, respectively. Additionally, there is the
package
lpSolveAPI
which provides an R interface to the
low level API routines of lp_solve (see also project
lpsolve
on
R-Forge
).
lpSolveAPI
supports reading linear programs from files in lp
and MPS format. [BP, IP, LP, MILP, SPLP]
-
Package
glpk
as well as package
Rglpk
provide an interface to
the
GNU Linear
Programming Kit
(GLPK). Whereas the former
provides high level access to
low level routines the latter offers a high level routine
Rglpk_solve_LP()
to solve
MILPs using GLPK.
Both packages offer the possibility to use models formulated in the
MPS format. [BP, IP, IPM, LP, MILP]
-
Rsymphony
provides the routine
Rsymphony_solve_LP()
which
interfaces the SYMPHONY solver for mixed integer linear
programs. SYMPHONY applies LP
relaxation with a branch-and-cut approach. It is part of the
Computational
Infrastructure for Operations Research
(COIN-OR) project which is an initiative to spur the
development of open source software for the operations research
community. [LP, IP, MILP]
-
The CSDP semidefinite programming library is interfaced by
package
Rcsdp. [SDP]
Interfaces to Commercial Optimizers
This section surveys interfaces to commercial solvers. Typically, the
corresponding libraries have to be installed separately.
-
Package
Rcplex
provides an interface to the CPLEX solver
package from
ILOG
. It provides dual/primal simplex optimizers as well as
a barrier optimizer for solving large scale linear
and quadratic programs. Furthermore, it offers a mixed integer optimizer
to solve difficult mixed integer programs. Note that CPLEX is
not free
and you have to get a license from
ILOG
. [LP, IP,
BP, QP, MILP, MIQP, IPM]
-
In package
clue
solve_LSAP()
enables
the user to solve the linear
sum assignment problem (LSAP) using an efficient C implementation of
the Hungarian algorithm. [SPLP]
-
Package
goalprog
provides some functions for
lexicographic linear goal
programming and optimization. Goal programming is a branch of
multi-objective, multi-criteria decision analysis. [MOP]
-
Multi-criteria optimization problems can be solved using
package
mco
which implements genetic
algorithms. [MOP]
-
igraph, a package for graph and network analysis,
uses the very fast igraph C library. It can be used to calculate
shortest paths, maximal network flows, minimum
spanning trees, etc. [GRAPH]
-
maxLik
adds a likelihood-specific layer on top of
a number of maximization routines like Brendt-Hall-Hall-Hausman
(BHHH) and Newton-Raphson
among others. It includes summary and print methods which
extract the standard errors based on the Hessian matrix and allows easy
swapping of maximization algorithms.
-
Package
quantreg
contains variations of simplex and
of interior point routines (
nlrq(),
crq()). It provides an interface to L1 regression
in the R code of function
rq(). [SPLP, LP, IPM]
-
Package
optmatch
provides routines for solving
matching problems by translating
them into minimum-cost flow problems, which are in turn solved
optimally by the RELAX-IV codes
of Bertsekas and Tseng (free for research). [SPLP]
-
Package
sna
contains the function
lab.optim()
which is the front-end to a series of heuristic routines for optimizing
some bivariate graph statistic. [GRAPH]
-
Package
TSP
provides basic infrastructure for
handling and solving the
traveling salesperson problem (TSP). The main routine
solve_TSP()
solves the TSP
through several heuristics. In addition, it provides an interface
to the
Concorde TSP
Solver
, which has to be
downloaded separately. [SPLP]
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
code (if available) are
given in brackets.
-
LP (Linear programming, 90C05):
boot,
glpk,
limSolve,
linprog,
lpSolve,
lpSolveAPI,
rcdd,
Rcplex,
Rglpk,
Rsymphony,
quantreg
-
GO (Global Optimization):
Rdonlp2
-
SPLP (Special problems of linear programming like transportation,
multi-index, etc., 90C08):
clue,
lpSolve,
lpSolveAPI,
optmatch,
quantreg,
TSP
-
BP (Boolean programming, 90C09):
glpk,
Rglpk,
lpSolve,
lpSolveAPI,
Rcplex
-
IP (Integer programming, 90C10):
glpk,
lpSolve,
lpSolveAPI,
Rcplex,
Rglpk,
Rsymphony
-
MIP (Mixed integer programming and its variants MILP for LP
and MIQP for QP, 90C11):
glpk,
lpSolve,
lpSolveAPI,
Rcplex,
Rglpk,
Rsymphony
-
SP (Stochastic programming, 90C15):
stoprog
-
QP (Quadratic programming, 90C20):
kernlab,
limSolve,
LowRankQP,
quadprog,
Rcplex
-
SDP (Semidefinite programming, 90C22):
Rcsdp
-
MOP (Multi-objective and goal programming, 90C29):
goalprog,
mco
-
NLP (Nonlinear programming, 90C30):
Rdonlp2
-
GRAPH (Programming involving graphs or networks, 90C35):
igraph,
sna
-
IPM (Interior-point methods, 90C51):
kernlab,
glpk,
LowRankQP,
quantreg,
Rcplex
-
RGA (Methods of reduced gradient type, 90C52): stats
(
optim()),
gsl
-
QN (Methods of quasi-Newton type, 90C53): stats
(
optim()),
gsl,
ucminf