Convex Optimization Problems

Master convex optimization problems by getting hands-on experience with executable programs using CVXPY.

Convex optimization problems can be expressed in various standard forms, each with advantages and disadvantages depending on the specific problem. Here are some of the most common standard forms of convex optimization problems:

Linear programming (LP)

This is the simplest form of convex optimization problems, where the objective function and the inequality constraints are affineaffine. The general form of an LP problem is:

minxcTxs.t.Axb\begin{aligned} \min_{\bold x} \quad & \bold c^T\bold x\\ \textrm{s.t.} \quad & A\bold x \le \bold b \end{aligned}

Here, x\bold x is the optimization variable, c\bold c and b\bold b are vectors, and AA is a matrix.

Example of LP

Consider the objective to be maximized of an optimization problem as follows:

f(x,y)=x+yf(x,y) = x + y

The constraints are as follows:

25x+35y<=5000x>=50y>=60\begin{aligned} 25x + 35y & <= 5000 \\ x &>= 50 \\ y &>= 60 \end{aligned}

The above problem can be reformulated as standard LP if x=[xy],c=[11],A=[25351001]\bold x =\begin{bmatrix}x \\ y\end{bmatrix} ,\quad \bold c = \begin{bmatrix}-1 \\ -1\end{bmatrix},\quad A=\begin{bmatrix}25 & 35 \\ -1 & 0\\ 0 & -1\end{bmatrix} and b=[50005060]\bold b=\begin{bmatrix}5000 \\ -50 \\ -60\end{bmatrix}. The following code solves this LP using cvxpy:

Get hands-on with 1200+ tech skills courses.