title | author | date |
---|---|---|
Convex Optimization: A Practical Guide |
Behzad Samadi |
February 17, 2014 |
Behzad Samadi
February 17, 2014
$\DeclareMathOperator{\sign}{sgn} \newcommand{\CO}{\textbf{\rm conv}} \newcommand{\RR}{{\mathcal R}} \newcommand{\RE}{\mathbb{R}} \newcommand{\TR}{\text{T}} \newcommand{\beq}{\begin{equation}} \newcommand{\eeq}{\end{equation}} \newcommand{\bmat}{\left[\begin{array}} \newcommand{\emat}{\end{array}\right]} \newcommand{\bsmat}{\left[\begin{smallmatrix}} \newcommand{\esmat}{\end{smallmatrix}\right]} \newcommand{\barr}{\begin{array}} \newcommand{\earr}{\end{array}} \newcommand{\bsm}{\begin{smallmatrix}} \newcommand{\esm}{\end{smallmatrix}}$
-
Introduction
-
Convex sets
-
Convex functions
-
Convex optimization
-
Linear program
-
Quadratic program
-
Second order cone program
-
Semidefinite program
-
-
Applications
-
Stability
-
Dissipativity
-
In this presentation, the definitions are taken from the Convex Optimization book by Stephen Boyd and Lieven Vandenberghe unless otherwise stated. The reader is referred to the book for a detailed review of the theory of convex optimization and applications.
$\begin{align} \text{minimize}&f(x)\nonumber \newline \text{subject to}& x\in C \end{align}$
where
-
Convex optimization problems:
-
can be solved numerically with great efficiency
-
have extensive useful theory
-
occur often in engineering problems
-
often go unrecognised
-
Given
$\begin{equation} x = \sum_{i=1}^m \lambda_ix_i \end{equation}$
where
$\begin{equation} \sum_{i=1}^m\lambda_i=1 \end{equation}$
Convex set: A set
Convex hull: The convex hull of a set
Affine combination:
Affine set: A set
Cone (nonnegative) combination: Cone combination of two points
with
Convex cone: A set
Hyperplane: A hyperplane is a set of the form
Halfspace: A halfspace is a set of the form
Polyhedron: A polyhedron is the intersection of finite number of hyperplanes and halfspaces. A polyhedron can be written as:
where
Euclidean ball: A ball with center
$\begin{equation} B(x_c,r)={x| |x-x_c|_2\leq r}={x| x=x_c+ru, |u|_2\leq r} \end{equation}$
Ellipsoid: An ellipsoid is defined as:
$\begin{equation} {x | (x-x_c)^\text{T}P^{-1}(x-x_c)\leq 1} \end{equation}$
where
-
Proper cone: A cone is proper if it is:
-
closed (contains its boundary)
-
solid (has nonempty interior)
-
pointed (contains no lines)
-
-
The nonnegative orthant of
$\mathbb{R}^n$ ,${x|x\in\mathbb{R}^n,x_i\geq 0, i=1,\ldots,n }$ is a proper cone. -
Also the cone of positive semidefinite matrices in
$\mathbb{R}^{n\times n}$ is a proper cone.
A generalized inequality is defined by a proper cone
$\begin{equation} x\preceq_K y \Leftrightarrow y-x\in K \end{equation}$
$\begin{equation} x\prec_K y \Leftrightarrow y-x\in \text{interior}(K) \end{equation}$
In this context, we deal with the following inequalities:
-
The inequality on real numbers is defined based on the proper cone of nonnegative real numbers
$K=\mathbb{R}_+$ . -
The componentwise inequality on real vectors in
$\mathbb{R}^n$ is defined based on the nonnegative orthant$K=\mathbb{R}^n_+$ . -
The matrix inequality is defined based on the proper cone of positive semidefinite matrices
$K=S^n_+$ .
Definition: A function
A mathematical optimization is convex if the objective is a convex function and the feasible set is a convex set. The standard form of a convex optimization problem is: $\begin{align} \text{minimize } & f_0(x) \nonumber\newline \text{subject to } & f_i(x) \leq 0,\ i=1,\ldots,m\nonumber\newline & h_i(x) = 0,\ i=1,\ldots,p \end{align}$
where
Linear programming (LP) is one of the best known forms of convex optimization.
$\begin{align}\label{LP} \text{minimize }&c^\text{T}x\nonumber\newline \text{subject to }&a_i^\text{T}x\leq b_i,\ i=1,\ldots,m \end{align}$
where
-
In general, no analytical solution
-
Numerical algorithms
-
Early algorithm, the one developed by Kantorovich in 1940 [@Kantorovich40]\
-
The simplex method proposed by George Dantzig in 1947 [@Dantzig91]
-
The Russian mathematician L. G. Khachian developed a polynomial-time algorithm in 1979 [@Khachian79]
-
The algorithm was an interior method, which was later improved by Karmarkar in 1984 [@Karmarkar84]
-
If some of the entries of
$x$ are required to be integers, we have a Mixed Integer Linear Programming (MILP) program. -
A MILP problem is in general difficult to solve (non-convex and NP-complete).
-
In practice, the global optimum can be found for many useful MILP problems.
$\begin{align} \text{maximize: } & x + y\nonumber\ \text{Subject to: } & x + y \geq -1 \ \text{} & \frac{x}{2}-y \geq -2\nonumber\ \text{} & 2x-y \leq -4\nonumber \end{align}$
import numpy as np
from pylab import *
import matplotlib as mpl
import cvxopt as co
import cvxpy as cp
x = cp.Variable(1)
y = cp.Variable(1)
constraints = [ x+y >= -1.,
0.5*x-y >= -2.,
2.*x-y <= 4.]
objective = cp.Maximize(x+y)
p = cp.Problem(objective, constraints)
The solution of the LP problem is computed with the following command:
result = p.solve()
print(round(result,5))
8.0
The optimal solution is now given by:
x_star = x.value
print(round(x_star,5))
4.0
y_star = y.value
print(round(y_star,5))
4.0
$\begin{align} \text{minimize: } & x + y\nonumber\ \text{Subject to: } & x + y \geq -1 \ \text{} & \frac{x}{2}-y \leq -2\nonumber\ \text{} & 2x-y \leq -4\nonumber \end{align}$
objective = cp.Minimize(x+y)
p = cp.Problem(objective, constraints)
result = p.solve()
print(round(result,5))
-1.0
The optimal solution is now given by:
x_star = x.value
print(round(x_star,5))
0.49742
y_star = y.value
print(round(y_star,5))
-1.49742
-
The optimal value of the objective function is unique.
-
Any point on the line connecting the two points (-2,1) and (1,-2) is the optimal solution.
-
This LP problem has infinite optimal solutions.
-
The code, however, returns just one of the optimal solutions.
Consider the following polyhedron:
$\begin{equation} \mathcal{P} = {x | a_i^Tx \leq b_i, i=1,...,m } \end{equation}$
The Chebyshev center of
$\begin{equation} \mathcal{B}={x||x-x_c|\leq r} \end{equation}$
-
For
$\mathcal{B}$ to be inside$\mathcal{P}$ , we need to have:$a_i^Tx\leq b_i,\ i=1,\ldots,m$ for all$x$ in$\mathcal{B}$ -
For each
$i$ , the point with the largest value of$a_i^Tx$ is:$x^\star=x_c+\frac{r}{\sqrt{a_i^Ta_i}}a_i=x_c+\frac{r}{|a_i|_2}a_i$ -
Therefore:
$a_i^Tx_c+r|a_i|_2\leq b_i, i=1,..,m\ \Rightarrow \mathcal{B}$ is inside$\mathcal{P}$
Now, we can write the problem as the following LP problem (LP3):
$\begin{align} \text{maximize: } & r\nonumber\ \text{Subject to: } & a_i^Tx_c + r|a_i|_2 \leq b_i,\ i=1,..,m \end{align}$
[]: cvxguide_files/cvxguide_31_0.png