Part 9 - Linear Programming: Introduction

Introduction

In this part we will cover the concept of Linear Programming (LP) and its standard form (we briefly introduced this last part, but we will formalize it here). We will then introduce the concept of Basic (Feasible) Solutions, which is a very important concept in LP theory. Finally, we will talk about the idea(s) that will lead us to the Simplex method, which is a very efficient method for solving LPs in practice.

Linear Programming

Definition 1 (Linear Programming)

A linear program (LP) is a problem of the form,

min cTxsubject to xP\begin{align*} \min \ & \mathbf{c}^T \mathbf{x} \newline \text{subject to} \ & \mathbf{x} \in P \end{align*}

where PRnP \subseteq \mathbb{R}^n is a polyhedron.

Recall (Polyhedron)

A polyhedron PRnP \subseteq \mathbb{R}^n is a set of the form,

P={xRnA~xb~},P = \{\mathbf{x} \in \mathbb{R}^n \mid \tilde{A} \mathbf{x} \leq \tilde{b}\},

for some A~Rm×n\tilde{A} \in \mathbb{R}^{m \times n} and b~Rm\tilde{b} \in \mathbb{R}^m.

A polyhedron in .
A polyhedron in .
Remark 1 (Observations on properties of LPs)
  1. We see that the polyhedron PP is the set of the intersection of half-spaces, which means that it is a convex set.
  2. The boundaries are straight lines (hyperplanes in higher dimensions).
  3. There will always be a finite number of extreme points (corners) in a polyhedron.
  4. The polyhedron can be unbounded (extend to infinity in some direction).
Intuition (Geometric Intuition of LPs)

Imagine if we take a (hyper)plane perpendicular to the negative gradient of the objective function, i.e., perpendicular to x(cTx)=c-\nabla_{\mathbf{x}} (\mathbf{c}^T \mathbf{x}) = -\mathbf{c}, as far as possible while still touching the polyhedron PP.

The optimal solution to the LP should exist in an extreme point (corner) of the polyhedron PP where the (hyper)plane touches it (we will prove this later).

The feasible region, gradient field of the objective function and the optimal solution.
The feasible region, gradient field of the objective function and the optimal solution.

Standard Form

Definition 2 (Standard Form of a Linear Program)

An LP on standard form is,

min cTxsubject to Ax=b x0\begin{align*} \min \ & \mathbf{c}^T \mathbf{x} \newline \text{subject to} \ & A \mathbf{x} = \mathbf{b} \newline \ & \mathbf{x} \geq \mathbf{0} \end{align*}
Note

Any Linear Program can be converted to standard form, we will not prove this, but let’s take an example to illustrate how we can do this.

Example 1 (Converting to Standard Form)

Convert the following LP to standard form,

min x2subject to x1x21 x1+x21 x1,x20\begin{align*} \min \ & x_2 \newline \text{subject to} \ & x_1 - x_2 \leq 1 \newline \ & x_1 + x_2 \geq 1 \newline \ & x_1, x_2 \geq 0 \end{align*}
Solution

We start by rewriting the inequalities as equalities by introducing slack variables.

Slack variables are variables that “take up the slack” in an inequality constraint to turn it into an equality constraint (i.e., positive slack variables for \leq constraints and negative slack variables for \geq constraints).

x1x2+s1=1x1+x2s2=1x1,x2,s1,s20\begin{align*} x_1 - x_2 + s_1 & = 1 \newline x_1 + x_2 - s_2 & = 1 \newline x_1, x_2, s_1, s_2 & \geq 0 \end{align*}

where s1,s20s_1, s_2 \geq 0 are slack

Now, we can rewrite everything in matrix form,

x=[x1x2s1s2],c=[0100],A=[11101101],b=[11]\begin{align*} \mathbf{x} & = \begin{bmatrix} x_1 \newline x_2 \newline s_1 \newline s_2 \end{bmatrix}, \quad \mathbf{c} = \begin{bmatrix} 0 \newline 1 \newline 0 \newline 0 \end{bmatrix}, \quad A = \begin{bmatrix} 1 & -1 & 1 & 0 \newline 1 & 1 & 0 & -1 \end{bmatrix}, \quad \mathbf{b} = \begin{bmatrix} 1 \newline 1 \end{bmatrix} \end{align*}

Thus, the LP in standard form is,

min cTxsubject to Ax=b x0\begin{align*} \min \ & \mathbf{c}^T \mathbf{x} \newline \text{subject to} \ & A \mathbf{x} = \mathbf{b} \newline \ & \mathbf{x} \geq \mathbf{0} \end{align*}

Basic (Feasible) Solutions

Definition 3 (Basic Solution)

A point xˉ\bar{\mathbf{x}} is called a basic solution if,

  1. Axˉ=bA \bar{\mathbf{x}} = \mathbf{b},
  2. The columns of AA corresponding to the non-zero components of xˉ\bar{\mathbf{x}} are linearly independent.
Intuition (Procedure to find Basic Solutions)
  1. Choose mm linearly independent columns of ARm×nA \in \mathbb{R}^{m \times n} where mnm \leq n.
  2. Rearrange the columns so that,
A=[BN],A = \begin{bmatrix} B & N \end{bmatrix},

where BRm×mB \in \mathbb{R}^{m \times m} matrix with the chosen columns (basic variables) and NRm×(nm)N \in \mathbb{R}^{m \times (n - m)} matrix with the remaining columns (non-basic variables).

Thus, linear independence     rank(B)=m    B\iff \mathrm{rank}(B) = m \iff B is invertible. 3. Rearrange x\mathbf{x} so that,

x=[xBxN],\mathbf{x} = \begin{bmatrix} \mathbf{x}_B \newline \mathbf{x}_N \end{bmatrix},

this means that,

Ax=BxB+NxNA \mathbf{x} = B \mathbf{x}_B + N \mathbf{x}_N
  1. Set xN=0\mathbf{x}_N = \mathbf{0}.

  2. Set xB=B1b\mathbf{x}_B = B^{-1} \mathbf{b}.

Note

One property of this procedure is that, there at most (nm)=n!m!(nm)!\binom{n}{m} = \frac{n!}{m!(n - m)!} basic solutions (since this is the number of ways to choose mm columns from nn columns).

Definition 4 (Basic Feasible Solution)

A point xˉ\bar{\mathbf{x}} is called a basic feasible solution (BFS), if,

  1. xˉ\bar{\mathbf{x}} is a basic solution,
  2. xˉ0\bar{\mathbf{x}} \geq \mathbf{0}.
Note

A BFS is a point in the feasible region (polyhedron) P={xRnAx=b, x0}P = \{\mathbf{x} \in \mathbb{R}^n \mid A \mathbf{x} = \mathbf{b}, \ \mathbf{x} \geq \mathbf{0}\}.

Theorem 1 (Extreme Points and Basic Feasible Solutions)

Let AA have rank(A)=m\mathrm{rank}(A) = m. x\mathbf{x} is an extreme point of P={xRnAx=b, x0}P = \{\mathbf{x} \in \mathbb{R}^n \mid A \mathbf{x} = \mathbf{b}, \ \mathbf{x} \geq \mathbf{0}\} if and only if x\mathbf{x} is a basic feasible solution.

Example 2 (Basic (Feasible) Solutions)

Consider the polyhedron defined by,

2x1+x21x1x21x1,x20\begin{align*} -2x_1 + x_2 & \leq 1 \newline x_1 - x_2 \leq 1 \newline x_1, x_2 & \geq 0 \end{align*}

Generate two BS and check if they are BFS.

The feasible region and the extreme points.
The feasible region and the extreme points.
Solution

We start by converting the inequalities to equalities by introducing slack variables,

2x1+x2+s1=1x1x2+s2=1x1,x2,s1,s20\begin{align*} -2x_1 + x_2 + s_1 & = 1 \newline x_1 - x_2 + s_2 & = 1 \newline x_1, x_2, s_1, s_2 & \geq 0 \end{align*}

where s1,s20s_1, s_2 \geq 0 are slack variables Now, we can rewrite everything in matrix form,

x=[x1x2s1s2],A=[21101101],b=[11]\begin{align*} \mathbf{x} & = \begin{bmatrix} x_1 \newline x_2 \newline s_1 \newline s_2 \end{bmatrix}, \quad A = \begin{bmatrix} -2 & 1 & 1 & 0 \newline 1 & -1 & 0 & 1 \end{bmatrix}, \quad \mathbf{b} = \begin{bmatrix} 1 \newline 1 \end{bmatrix} \end{align*}

We see that rank(A)=2\mathrm{rank}(A) = 2. We will now generate two basic solutions. For the first BS, e.g.,

xB=[x1s2],xN=[x2s1],B=[2011],N=[1110]\begin{align*} \mathbf{x}_B & = \begin{bmatrix} x_1 \newline s_2 \end{bmatrix}, \quad \mathbf{x}_N = \begin{bmatrix} x_2 \newline s_1 \end{bmatrix}, \newline B & = \begin{bmatrix} -2 & 0 \newline 1 & 1 \end{bmatrix}, \quad N = \begin{bmatrix} 1 & 1 \newline -1 & 0 \end{bmatrix} \end{align*}

We have,

xN=0xB=B1b=[1232]\begin{align*} \mathbf{x}_N & = \mathbf{0} \newline \mathbf{x}_B & = B^{-1} \mathbf{b} = \begin{bmatrix} -\frac{1}{2} \newline \frac{3}{2} \end{bmatrix} \end{align*}

Thus, the first BS is,

xˉ=[120032]\bar{\mathbf{x}} = \begin{bmatrix} -\frac{1}{2} \newline 0 \newline 0 \newline \frac{3}{2} \end{bmatrix}

which is not a BFS since xˉ≱0\bar{\mathbf{x}} \not\geq \mathbf{0}.

For the second BS, e.g.,

xB=[x2s2],xN=[x1s1],B=[1011],N=[2110]\begin{align*} \mathbf{x}_B & = \begin{bmatrix} x_2 \newline s_2 \end{bmatrix}, \quad \mathbf{x}_N = \begin{bmatrix} x_1 \newline s_1 \end{bmatrix}, \newline B & = \begin{bmatrix} 1 & 0 \newline -1 & 1 \end{bmatrix}, \quad N = \begin{bmatrix} -2 & 1 \newline 1 & 0 \end{bmatrix} \end{align*}

We have,

xN=0xB=B1b=[12]\begin{align*} \mathbf{x}_N & = \mathbf{0} \newline \mathbf{x}_B & = B^{-1} \mathbf{b} = \begin{bmatrix} 1 \newline 2 \end{bmatrix} \end{align*}

Thus, the second BS is,

xˉ=[0102]\bar{\mathbf{x}} = \begin{bmatrix} 0 \newline 1 \newline 0 \newline 2 \end{bmatrix}

which is a BFS since xˉ0\bar{\mathbf{x}} \geq \mathbf{0}.

Note

From the figure, we can see that the first point is indeed the intersection of two inequalities (i.e., it fulfills the first and last inequality with equality), but it is not in the feasible region since it has a negative component.

The second point is also the intersection of two inequalities (i.e., it fulfills the second and last inequality with equality), and it is in the feasible region since it has no negative components.

Theorem 2 (Optimal Solutions and Basic Feasible Solutions)

Let,

z=inf cTxsubject to xPz^{\star} = \begin{align*} \inf \ & \mathbf{c}^T \mathbf{x} \newline \text{subject to} \ & \mathbf{x} \in P \end{align*}

where P={xRnAx=b, x0}P = \{\mathbf{x} \in \mathbb{R}^n \mid A \mathbf{x} = \mathbf{b}, \ \mathbf{x} \geq \mathbf{0}\}.

  1. zz^{\star} is finite if and only if PP is non-empty and cTd0\mathbf{c}^T \mathbf{d} \geq 0 for all d{vRnAv=0, v0}\mathbf{d} \in \{\mathbf{v} \in \mathbb{R}^n \mid A \mathbf{v} = \mathbf{0}, \ \mathbf{v} \geq \mathbf{0}\}.

  2. If zz^{\star} is finite, then there exists an optimal solution among the extreme points of PP (i.e., among the BFSs).

Note

Other points then extreme points might also be optimal solutions, but there will always be an optimal solution that is an extreme point (BFS).

Ideas Leading to the Simplex Method

We will now discuss some ideas that will lead us to the Simplex method, which is a very efficient method for solving LPs in practice.

Definition 5 (Degenerate)

A BFS xˉ\bar{\mathbf{x}} is called degenerate if, two partitions [BN]\begin{bmatrix} B & N \end{bmatrix} and [B~N~]\begin{bmatrix} \tilde{B} & \tilde{N} \end{bmatrix} corresponds to xˉ\bar{\mathbf{x}}.

Equivalently, a BFS is degenerate if some basic variable is zero.

Definition 6 (Adjacent)

Two BFSs x1\mathbf{x}_1 and x2\mathbf{x}_2 are called adjacent if,

yαx1+(1α)x2, α(0,1),y=λu+(1λ)v, u,vP, λ(0,1)    {u=λux1+(1λu)x2,v=λvx1+(1λv)x2,\begin{align*} \forall \mathbf{y} & \in \alpha \mathbf{x}_1 + (1 - \alpha) \mathbf{x}_2, \ \alpha \in (0, 1), \newline \mathbf{y} & = \lambda \mathbf{u} + (1 - \lambda) \mathbf{v}, \ \mathbf{u}, \mathbf{v} \in P, \ \lambda \in (0, 1) \newline & \implies \newline & \begin{cases} \mathbf{u} = \lambda_{\mathbf{u}} \mathbf{x}_1 + (1 - \lambda_{\mathbf{u}}) \mathbf{x}_2, \newline \mathbf{v} = \lambda_{\mathbf{v}} \mathbf{x}_1 + (1 - \lambda_{\mathbf{v}}) \mathbf{x}_2, \newline \end{cases} \end{align*}

or simply, for two vertices to be adjacent, the line segment connecting them must lie on the boundary of the polyhedron (i.e., it cannot pass through the interior of the polyhedron).

For example, the points (1,0)(1, 0) and (0,0)(0, 0) are adjacent, but the points (1,0)(1, 0) and (0,1)(0, 1) are not.

The feasible region and the extreme points.
The feasible region and the extreme points.
Theorem 3 (Characterization of Adjacent BFSs)

Let x1\mathbf{x}_1 and x2\mathbf{x}_2 be two different BFS. Let them correspond to [B1N1]\begin{bmatrix} B_1 & N_1 \end{bmatrix} and [B2N2]\begin{bmatrix} B_2 & N_2 \end{bmatrix}, respectively. Assume that all columns but one in B1B_1 and B2B_2 are the same.

Then, x1\mathbf{x}_1 and x2\mathbf{x}_2 are adjacent BFSs.

Intuition (Algorithmic Idea to Move Between Adjacent BFSs)

Lastly, we will discuss the blueprint for an algorithm to find an optimal solution to an LP.

  1. Start at a BFS.
  2. Move to adjacent BFS for which the objective function is improved (decreased for minimization problems).
  3. Repeat step 2 until no adjacent BFS improves the objective function.