# Unrestricted-in-Sign Variables

## Presentation on theme: "Unrestricted-in-Sign Variables"— Presentation transcript:

Unrestricted-in-Sign Variables
In solving LPs with the simplex algorithm, we used the ratio test to determine the row in which the entering variable became a basic variable. Recall that the ratio test depended on the fact that any feasible point required all variables to be nonnegative. Thus, if some variables are allowed to be unrestricted in sign (urs), the ratio test and therefore the simplex algorithm are no longer valid. In this section, we show how an LP with unrestricted-in-sign variables can be transformed into an LP in which all variables are required to be nonnegative.

For each urs variable xi, we begin by defining two new variables xi` and xi``. Then substitute xi `- xi`` for xi in each constraint and in the objective function. Also add the sign restrictions xi ` and xi `` . The effect of this substitution is to express xi as the difference of the two nonnegative variables xi ‘and xi’’. Because all variables are now required to be nonnegative, we can proceed with the simplex.

Example- Baker Problem
A baker has 30 oz of flour and 5 packages of yeast. Baking a loaf of bread requires 5 oz of flour and 1 package of yeast. Each loaf of bread can be sold for 30¢. The baker may purchase additional flour at 4¢/oz or sell leftover flour at the same price. Formulate and solve an LP to help the baker maximize profits (revenues costs).

Baker Problem Define x1 = number of loaves of bread baked
x2 = number of ounces by which flour supply is increased by cash transactions Therefore, x2 > 0 means that x2 oz of flour were purchased, and x2 <0 means that x2 ounces of flour were sold (x2 = 0 means no flour was bought or sold). After noting that x1 ≥ 0 and x2 is urs, the appropriate LP is

Objective function z = 30x1-4x2 Subject to 5x1 ≤ 30+x2 x1 ≤ 5 x1 ≥ 0 and x2 is urs

Put x2=x2`- x2`` Maximize z= 30x1-4x2’+4x2`` S.T 5x1 ≤ 30+x2`-x2`` x1 ≤ 5 x1,x2`,x`` ≥ 0

Maximize z= 30x1-4x2’+4x2`` S.T 5x1-x2`+x2`` ≤ 30 x1 ≤ 5 x1,x2`,x`` ≥ 0

Maximize z= 30x1-4x2’+4x2`` z- 30x1+4x2’-4x2``=0 5x1-x2`-x2`` +s1=30
S.T 5x1-x2`-x2`` +s1=30 x1 +s = 5 x1,x2`,x`` ≥ 0 z- 30x1+4x2’-4x2``=0

Simplex Method z x1 X2` X2`` s1 s2 sol Basic var ration 1 -30 4 -4 z=0
z=0 5 -1 30 S1=30 S2=5

Simplex Method x1 -30 5 z X2` X2`` s1 s2 sol Basic var ration 1 4 -4
z=0 5 -1 30 S1=30 6 S2=5

Simplex Method x1 -30 5 S2=5 z X2` X2`` s1 s2 sol Basic var ration 1 4
-4 z=0 5 -1 30 S1=30 S2=5

Simplex Method s2 is leaving and x1 in entering
z x1 X2` X2`` s1 s2 sol Basic var ration 1 4 -4 30 150 z=150 5 -1 S1=30 S2=5

Simplex Method s2 is leaving and x1 is entering
z x1 X2` X2`` s1 s2 sol Basic var ration 1 4 -4 30 150 z=150 -1 -5 5 S1=5 x1=5

Simplex Method s1 is leaving and x2`` is entering
z x1 X2` X2`` s1 s2 sol Basic var ration 1 4 -4 30 150 z=150 -1 -5 5 S1=5 x1=5 inf

Simplex Method s1 is leaving and x2``is entering
z x1 X2` X2`` s1 s2 sol Basic var ration 1 4 -4 30 150 z=150 -1 -5 5 S1=5 x1=5

Simplex Method s2 is leaving and x1 is entering
z x1 X2` X2`` s1 s2 sol Basic var ration 1 4 10 170 z=170 -1 -5 5 X2``=5 x1=5