How do I convert this LP model to standard form?
How to convert linear programming model to standard form?
6.5k Views Asked by mmswe https://math.techqa.club/user/mmswe/detail AtThere are 2 best solutions below
Standard form varies from author to author as @M. Stawiski noted in the comments. Nevertheless in the various texts I have seen there are generally two recurring themes. Writing the system in the form of
$$ Ax \le b, x \ge 0$$
where $x$ is a vector in $\Bbb{R}^n$ and $A,b$ are matrices and vector respectively, or
$$ Ax = b, x \ge 0 $$.
Lets cover form 1. Any inequality that is $\le$ need not be changed. Lines with a $\ge$ can be multiplied to flip the sign, and a trickier one is if someone throws at you $=$ constraints. Of which you have given none. But suppose you had a line such as
$$ 2x_1 + 3x_2 = 4 $$
Then you can just write as
$$ \begin{pmatrix} 2x_1 + 3x_2 \le 4 \\2x_1 + 3x_2 \ge 4 \end{pmatrix} $$
And then flip the bottom one to yield
$$ \begin{pmatrix} 2x_1 + 3x_2 \le 4 \\-2x_1 - 3x_2 \le -4 \end{pmatrix} $$
Lastly (now this doesn't apply in your case) suppose someone throws in a variable $x_r$ that is unconstrainted. Then we can rewrite $x_r$ as $x_j - x_k$ where $x_j,x_k \ge 0$ then make that subsitution. Eventually after doing sign flipping, breaking inequalities, and substitutions you will have only $\le$ signs, and your variables will be $\ge 0$ observe in your case:
$$ \begin{pmatrix} -x_1 + 3x_2 \le 3 \\ -2x_1 - x_2 \le 2 \\ 2x_1 + x_2 \le 8 \\ 4x_1 - x_2 \le 16 \end{pmatrix} \rightarrow \begin{pmatrix} -1 & 3 \\ -2 & -1 \\ 2 & 1 \\ 4 & -1\end{pmatrix} \begin{pmatrix} x_1 \\ x_2\end{pmatrix} \le \begin{pmatrix} 3 \\ 2 \\ 8 \\ 16 \end{pmatrix} x_1, x_2 \ge 0 $$
So here you are in standard from with $A$ that matrix, $b$ the vector on the right side and $x$ the pair of two variables which is strictly positive.
Two of possible standard form notation used by different authors (maybe there are more):
First gives 3 conditions:
1)maximalization of function
2)constraints in the form $c_1x_1+c_2x_2+\dots c_nx_n \leq b_j$
3)Non-negative variables
Second also gives 3 conditions:
1)minimalization of function
2)equality constraints
3)Non-negative variables
You should pick one (or maybe some other) and then transform the system of equation. Let's find the first form. To satisfy the first condition, note that the problem of minimalization of $f(X)$ is equal to maximalization of $-f(X)$. For the second condition, note that $c_1x_1+c_2x_2+\dots c_nx_n \leq b_j$ is equivalent to $-c_1x_1-c_2x_2-\dots -c_nx_n \geq -b_j$. So your problem may be expressed in (first) standard form as:
maximize $-3x_1+x_2$
subject to
$-x1+3x_2\leq3$
$-2x1-x_2\leq2$
$2x1+x_2\leq8$
$4x1-x_2\leq16$
$x_1,x_2\geq0$.
To obtain second type of standard form we will replace inequalities with equalities by introducing $x_3,x_4,x_5,x_6\geq 0$ and rewriting our problem as:
minimize $3x_1-x_2$
subject to
$-x1+3x_2+x_3=3$
$-2x1-x_2+x_4=2$
$2x1+x_2+x_5=8$
$4x1-x_2+x_6=16$
$x_1,x_2,x_3,x_4,x_5,x_6\geq0$.