What is linear programming?
A two-variable linear programming has a linear function $f(x,y)$ in two variables, called objective function, along with systems of linear inequalities called constraints which defines the feasible solution set as defined in systems of inequalities with two variables.
Linear programming is one of the methods of optimization where there is a need to find values of some variables $x$, $y$ so that function $f$ of the variables $x$, $y$ has a maximum or minimum value depending on the application to solve. Possible applications of linear programming may be found in engineering, agriculture, medicine, finance, economics, etc.
The solutions to a linear programming problem may be solved using the following theorems:
Examples with detailed solutions and explanations are presented.
Find the values of $x$ and $y$ that make $z(x , y) = 2x + 4y$ maximum subject to the conditions shown below and find the value of $z$ at these values of $x$ and $y$
\[
\begin{cases}
x \geq 0 \\
y \geq 0 \\
y \leq x + 1 \\
4y + x \leq 10 \\
y - x \geq -3 \\
\end{cases}
\]
.
The vertices were also found (in the same example) to be:
$A(0, 0)$, $B(0, 1)$, $C(\frac{6}{5}, \frac{11}{5})$, $D(\frac{22}{5}, \frac{7}{5})$, $E(3, 0)$
We now evaluate function $z(x , y) = 2x + 4y$ at all 5 vertices of the feasible set.
Find the minimum value of $z(x , y) = 4x + 7y$ where $x \geq 0$ and $y \geq 0$ subject to the conditions
\[
\begin{cases}
2x + 3y \geq 6 \\
x - \frac{y}{3} \leq 4 \\
-2x + 2y \leq 8 \\
x + \frac{5}{2}y \leq 13 \\
\end{cases}
\]
.
We now evaluate $z(x , y) = 4x + 7y$ at each vertex found above
at $A(0, 2)$: $z = 4(0) + 7(2) = 14$
at $B(0, 4)$: $z = 4(0) + 7(4) = 28$
at $C(\frac{6}{7}, \frac{34}{7})$: $z = 4(\frac{6}{7}) + 7(\frac{34}{7}) = 37.4$
at $D(\frac{86}{17}, \frac{54}{17})$: $z = 4(\frac{86}{17}) + 7(\frac{54}{17}) = 42.5$
at $E(4, 0)$: $z = 4(4) + 7(0) = 16$
at $F(3, 0)$: $z = 4(3) + 7(0) = 12$
Function $z = 4x + 7y$ has a minimum value of $12$ and occurs for $x = 3$ and $y = 0$ (vertex $F$).
Find the maximum value of the function $z = 3x + 3y$ where $x \geq 0$ and $y \geq 0$ subject to the conditions
\[
\begin{cases}
x \leq 6 \\
y \leq 7 \\
y \leq -x + 9 \\
\end{cases}
\]
The feasible set to the systems of inequalities given above is shown below.
vertices are at (see examples 2 and 3 above on how to find them)
$A(0, 0)$
$B(0, 7)$
$C(2, 7)$
$D(6, 3)$
$E(6, 0)$
.
Evaluate function $z = 3x + 3y$ at each vertex
at $A(0, 0)$ : $z = 3(0) + 3(0) = 0$
at $B(0, 7)$ : $z = 3(0) + 3(7) = 21$
at $C(2, 7)$ : $z = 3(2) + 3(7) = 27$
at $D(6, 3)$ : $z = 3(6) + 3(3) = 27$
at $E(6, 0)$ : $z = 3(6) + 3(0) = 18$
Function $z = 3x + 3y$ has a maximum value at two vertices: $C$ and $D$. In fact all points between $C$ and $D$ on the line $y = -x + 9$ gives $z = 27$.
Explanation: $z$ may be written as
$z = 3(x + y)$
The equation of the line through $BC$ is $y = -x + 9$ may be written as $x + y = 9$
Substitute $x + y$ by $9$ in $z = 3(x + y)$ to obtain
$z = 3(9) = 27$ and is maximum for all point on the line $y = -x + 9$.