oppy API

oppy: optimization in python

Documentation is available in the docstrings and online here.

The idea behind oppy was to provide some optimization methods which are used in the group of Prof. Dr. Volkwein quite often. After a while oppy grew up to a whole optimization package.

Besides algorithms for solving constrained, unconstrained and non-linear optimization problems, the package contains built-in iterative methods for solving linear systems.

Advanced methods for optimization are included such as SQP (Square Quadratic Programming), Augmented Lagrangian and different newton-type methods. Furthermore certain Krylov methods are implemented for solving linear systems in a stable way.

The goal is to provide a straightforward integration of the library to other applications such that other methods benefit from it.

The package is still in develop mode.

Available subpackages

conOpt

Subpackage which provide methods for constraint optimization. Equality and inequality constraint problems

\[\min_{x \in \mathbb{R}^n} f(x)\]

subject to

\begin{eqnarray} e(x) & = 0 \\ g(x) & \leq 0 \end{eqnarray}

can be solved by

  1. Penalty method
  2. Augmented Lagrangian method
  3. SQP with a BFGS update strategy (at the moment only equality constraint).

For box constraint problems

\[\min_{x \in \mathbb{R}^n} f(x)\]
\[\text{s. t. } x_a \leq x \leq x_b\]

the following methods are available

  1. Projected gradient Method
  2. The L-BFGS-B Method
  3. Projected Newton-Krylov Method (if you can provide the action of the second derivative).
itMet

Iterative methods for solving linear systems

\[Ax = b.\]

Here we can use either stationary methods

  1. Jacobi
  2. Gauß-Seidel
  3. SOR

or Krylov methods

  1. Steepest descent
  2. CG
  3. GMRES

For future release we are planing to add preconditioning in the Krylov methods. Stationary methods can then be used for precondition methods.

leastSquares

Subpackage which provide some methods for linear and nonlinear least squares problems, e.g:

\[\text{min} ||Ax - b||_2\]

and

\[\text{min} \frac{1}{2}||f(x)||_2^2\]

Right now we can solve this kind of problems with the following methods.

  • Linear Least Squares
    1. linear least squares (solving normal equation)
  • Nonlinear Least Squares
    1. Gauss-Newton algorithm with several choices.
    2. Line-search or trust-region based Levenberg Marquard algorithm with several choices.
linOpt

This subpackage contains solver for linear optimization problems e.g methods to solve

\[\text{max } c^T x\]
\[\text{s. t. } Ax \leq b\]
\[x \geq 0\]

with or without integer constraints. For that kind of problems we have the following methods:

  1. Simplex
  2. Branch and bound
multOpt

Scalarization methods for solving (possibly box-constrained) multiobjective optimization problems of the form

\[\min_{x \in \mathbb{R}^n} (f_1(x), \ldots, f_k(x)),\]
\[\text{s. t. } x_a \leq x \leq x_b.\]

The general idea of scalarization methods is to transform the multiobjective optimization problem into a series of scalar optimization problems. which can then be solved by using methods from unconstrained or constrained optimization (see the subpackages unconOpt or conOpt). Here we can use the following three scalarization methods

  1. Weighted-Sum method (WSM)
  2. Euclidean Reference Point method (ERPM)
  3. Pascoletti-Serafini method (PSM)
options
This subpackage contains the options class for all methods use in oppy.
results
This subpackage contains the class for the returns which oppy use.
tests
Unittests of oppy.
unconOpt

Subpackage which provide some methods for unconstrained optimization, e.g:

\[\min_{x \in \mathbb{R}^n} f(x)\]

Right now we can solve this kind of problems with line search based first- and second-order methods.

  • Line Search methods
    1. Armijo
    2. Wolfe-Powell
  • Optimization methods
    1. Gradient method
    2. Newton method
    3. Nonlinear CG (with different strategies like Fletcher-Reves)
    4. Quasi-Newton methods (with different strategies like BFGS, Broyden, DFP, …)
visualization
Some methods for visualization.

Utility tools

test              --- Run all oppy unittests
__version__       --- oppy version string
oppy.test(show=False)

Available subpackages

conOpt
Subpackage which provides some methods for constraint optimization.
itMet
Iterative methods for solving linear systems.
leastSquares
Least Squares optimization methods.
linOpt
Linear optimization methods.
multiOpt
Multiobjective optimization methods.
options
Module contains the options class for all methods use in oppy.
results
This module contains the class for the returns which oppy use.
tests
Unittests of oppy.
unconOpt
Subpackage which provides some methods for unconstrained optimization.
visualization
Some methods for visualization.

Subpackages