0% found this document useful (0 votes)
22 views10 pages

As4 Sol

Uploaded by

jjlnlovesmath
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views10 pages

As4 Sol

Uploaded by

jjlnlovesmath
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CO 370 Assignment 4 – Winter 2020

Solutions

Problem 1: Duality & Economic interpretation


You want to put together a team of workers.

• Workers come in types J := {1, . . . , n}.

• We identify skill types I := {1, . . . , m}.

• Every worker of type j ∈ J has a skill set Sj ⊆ I.

• The cost of hiring one worker of type j ∈ J is given by cj .

• For every skill i ∈ I we require bi workers that have that skill.

(i) Formulate as a Linear Program the problem of deciding how many workers of each type j to select
so that you minimize the total hiring cost.

Hint: Let xj denote the number of workers of type j selected (It is ok to hire fractional numbers of
workers, i.e. xj can be fractional).

Solution: X
min cj xj
j∈J

such that
X (P )
xj ≥ bi (i ∈ I) (1)
j∈J,i∈Sj

xj ≥ 0 (j ∈ J) (2)

(ii) Write the dual (D) of (P) where y denote the dual variables.

Solution: X
max bi yi
i∈I
such that
X (D)
yi ≤ cj (j ∈ J) (3)
i∈Sj

yi ≥ 0 (i ∈ I) (4)

(iii) Write the Complementary Slackness conditions for the pair (P) and (D).

Solution:
P
• xj = 0 or i∈Sj yi = cj ,
P
• yi = 0 or j∈J,i∈Sj xj = bi .

1
(iv) Think of yi as the cost of contracting an outside worker that can do the job of one worker with skill
i. Using this interpretation, discuss,
i. the dual constraints,
ii. the complementary slackness conditions,
iii. the Strong Duality Theorem.

Solution:
i. constraint (4) says that the costs are non-negative. The LHS of (3) computes the total cost of
contracting out skills done by one employee of type j. The RHS of (3) computes the cost of
employee of type j. If the inequality is not satisfied then the contracting costs are too high and
we are better off not using outside workers.
ii. The first CS condition can be rewritten as,
X
yi < cj ⇒ xj = 0,
i∈Sj

i.e., if the cost of contracting out skills for one employee of type j is less than the cost of one
employee j then we should not hire any employees of type j.
The second CS condition can be rewritten as,
X
xj > bi ⇒ yi = 0,
j∈J,i∈Sj

i.e., if we have more employees with skill i than we need then we are unwilling to pay to contract
out skill i.
iii. Strong duality says that for x optimal solution to (P) and y optimal solution to (D) we have,
X X
cj xj = bi yi ,
j∈J i∈I

i.e., cost of hiring all employees equals the cost of contracting out all the skills.

Problem 2: Total Unimodularity


(i) Consider a matrix A ∈ {0, 1}m×n such that whenever Aij = 1 and Akj = 1 for some j and for some
i < k, then we also have A`j = 1 for all i ≤ ` ≤ k. Let us call matrices that satisfy this property
consecutive ones (CO).
Prove that A is totally unimodular.

Solution: We use the Theorem of Ghouila, Houri (4.3.3). Consider some subset R be a subset
of the rows of A, and note that AR,• also satisfies CO. We will show that AR,• has an equitable
2-colouring.
To see this, let R = {i1 , . . . , iq }, and define
R1 = {ij ∈ R : j even},
and let R2 − R \ R1 be all remaining rows. It is not hard to see that
X X
Ai,• − Ai,•
i∈R1 i∈R2

is a ±1, 0-vector. Thus A is TU.

2
(ii) In the tripod cover (TC) problem, you are given a bipartite graph G = (A ∪ B, E), where

A = {a1 , . . . , ak }, and
B = {b1 , . . . , bq }.

A tripod is a set T = {e1 , e2 , e3 } ⊆ E(G) such that

e1 = (a, bi ), e2 = (a, bi+1 ), and e3 = (a, bi+2 ),

for some a ∈ A, and for some i ∈ {1, . . . , q}. Let T be a set of tripods. We construct 0, 1-matrix M
that has one column for each tripod T ∈ T , and one row for each vertex b ∈ B.
Show that matrix M is TU, or provide a tripod cover instance where M is not TU.

Solution: Order the rows of M by increasesing index of b. With this, note that M is CO. By (i),
we conclude that it is TU.

Problem 3: Sensitivity
Consider the following Linear Program,

min c> x
such that
(P )
Ax = b
x≤0

(a) Write the dual (D) of (P) and write the CS conditions for (P) and (D).

Solution: We have,
max{b> y : A> y ≥ c}. (D)
The CS conditions state:
xj = 0 or A>
•,j y = cj . (?)

Let B denote a basis of A and suppose that

• x̄ is a basic solution for Ax = b with basis B and

• ȳ = A−>
B cB .

We say that B is an optimal basis if x̄ is a feasible solution to (P) and ȳ is a feasible solution to (D).

(b) Prove that if B is an optimal basis then x̄ is an optimal solution to (P) and ȳ is an optimal solution
to (D).

Solution: We have that x̄ is a basic solution that is feasible for (P) and that ȳ = A−>
B cB is feasible
for (D).

Claim. x̄ and ȳ satisfy the CS conditions,

Proof. If x̄j > 0, then as x̄ is a basic solution, j ∈ B. Since we have A> B ȳ = cB we have in particular
that for all j ∈ B, A>•,j y = cj , and the CS conditions hold as required.

3
Now the result follows from the Claim and the Complementary Slackness Theorem.

(c) Let (P’) be obtained from (P) by replacing b by b + Θei for some row index i of A.
For what values of Θ will B remain optimal for (P’)?

Solution: We have,
min{c> x : Ax = b + Θei , x ≤ 0}, (P’)
with dual
max{(b + Θei )> y : A> y ≥ c}. (D’)
Note that (D) and (D’) have the same constraints. In particular, ȳ remains a feasible solution to (D’).
Thus it suffices to analyze when the primal basic solution x0 of B for (P’) remains feasible, i,e., for
what values of Θ do we have x0B ≤ 0. We have,

x0B = A−1 −1 −1 −1
B (b + Θei ) = AB b + Θei AB = x̄B + Θcoli (AB ).

Thus B will remain optimal for (P’) as long as,

x̄B + Θcoli (A−1


B ) ≤ 0.

(d) Let (P’) be obtained from (P) by replacing c by c + Θej for some column index j of A.
For what values of Θ will B remain optimal for (P’)?

Solution: We have,
min{(c + Θej )> x : Ax = b, x ≤ 0}, (P’)
with dual
max{b> z : A> z ≥ c + Θej }. (D’)
The reduced costs c̄ are defined as follows:

c̄> = c> − ȳ > A.

Note that (P) and (P’) have the same constraints. In particular x̄ remains a feasible solution to (D’).
Thus it suffices to analyze when the dual basic solution z̄ of B for (D’) remains feasible, i.e., for what
values of Θ do we have A> z̄ ≥ c + Θej . Equivalently, for all column indices k of A we need to check,
(
ck k 6= j
colk (A)> z̄ ≥ (†)
cj + Θ k = j

Case 1. j ∈
/ B.

Then z̄ = A−> >


B cB = ȳ. Since A ȳ ≥ c to verify (†) it suffice to check,

colj (A)> z̄ = colj (A)> ȳ ≥ cj + Θ,

or equivalently,
cj − colj (A)> ȳ ≤ Θ,
which can be written
c̄j ≤ −Θ.

4
Case 2. j ∈ B.

First let us relate ȳ and z̄.

z̄ = A−>
B (cB + Θej )
= A−> −>
B cB + Θcolj (AB ) (?)
= ȳ + Θrowj (A−1 >
B ) .

We have A>
B z̄ = cB + Θej . Thus to check (†) it suffices to verify that for all k ∈
/ B,

colk (A)> z̄ ≥ ck ,

or equivalently by (?),

0 ≥ ck − colk (A)> [ȳ + Θrowj (A−1 > −1


B ) ] = c̄k − Θrowj (AB )colk (A).

Thus the condition is that for all k ∈


/ B,

c̄k − Θrowj (A−1


B )colk (A) ≤ 0.

Important: The point of the exercise is for you to reproduce some of the proofs covered in class.

• Do not convert (P) into an equivalent LP in SEF.

• Prove everything using only results from Duality Theory.

Problem 4: Dual Simplex


Consider the linear program,
max{c> x : Ax = b, x ≥ 0}, (P)
where  
0
    −5
1 −3 −2 0 −1 0 −1  
−3
A = 0 5 1 1 1 0 b=  4  0 .
c= 
0 5 6 0 2 1 4  
−1
0

(a) Show that B = {1, 4, 6} is a basis that is dual feasible but not not primal feasible.

Solution: Let us write the tableau for basis B = {1, 4, 6},


 
1 0 5 3 0 1 0 0
 0
 1 −3 −2 0 −1 0 −1 

 0 0 5 1 1 1 0 4 
0 0 5 6 0 2 1 4

Thus b̄ = (−1, 4, 4)> which implies that B is not primal feasible, and c̄ = (0, −5, −3, 0, −1, 0)> which
implies that B is dual feasible.

5
(b) Starting from B = {1, 4, 6} use the Dual Simplex algorithm to find an optimal basis for (P).

Solution: Recall that we label rows of M and columns of M starting at 0. Since b̄1 = −1 < 0 we
choose row i = 1. Using the ratio test we select column j = 5. Thus we pivot on element (1, 5). The
new tableau is given by,  
1 1 2 1 0 0 0 −1
 0 −1 3 2 0 1 0 1 
 
 0 1 2 −1 1 0 0 3 
0 2 −1 2 0 0 1 2
Observe now that the new basis B = {4, 5, 6} is primal and dual feasible, thus optimal. In particular,
the solution x̄ = (0, 0, 0, 3, 1, 2)> is optimal.

Suppose now that,  


    0
1 0 0 1 −1 −1 0
 
A = 0 1 0 2 1  b = −2  0 .
c= 
0 0 1 1 2 3 −1
−1
(d) Show that B = {1, 2, 3} is a basis that is dual feasible but not not primal feasible.

Solution: Let us write the tableau for basis B = {1, 2, 3},


 
1 0 0 0 1 1 0
 0
 1 0 0 1 −1 −1 

 0 0 1 0 2 1 −2 
0 0 0 1 1 2 3

Observe that c̄ ≤ 0 but that b̄ 6≤ 0, thus B = {1, 2, 3} is dual feasible but not primal feasible.

(e) Starting from B = {1, 2, 3} use the Dual Simplex algorithm to find an optimal basis for (P).

Solution: Observe that the second constraints says x2 + 2x4 + x5 = −2 thus the primal problem
is unbounded or equivalently (as the dual is feasible) the dual problem is unbounded, so we can
stop. Note, you could pivot on element (1, 5) but it is pointless, once you can detect that the dual is
unbounded you should stop.

Problem 5: Tableaux – I
The purpose of this question is to prove an intermediate step towards Problem 6. Consider the following
pair of linear programs,
max{c> x + z̄ : Ax = b, x ≥ 0}, (P)
max{c0> x + z̄ 0 : A0 x = b0 , x ≥ 0}, (P’)
Let M denote the tableau representation of (P) and let M 0 denote the tableau representation of (P’).
Then we have,
−c> −c0> z̄ 0
   
1 z̄ 0 1
M= and M = .
0 A b 0 A0 b0
Denote entry (k, `) of A by ak` . Suppose that the first rows of M and M 0 are labeled 0 and that the first
columns of M and M 0 are labeled 0. Assume that A and A0 are m × n matrices. Then M and M 0 have
row indices 0, 1, . . . , m and column indices 0, 1, . . . , n, n + 1. Let i ∈ {1, . . . , m} and let j ∈ {1, . . . , n}.
Suppose that M 0 is obtained from M by pivoting on element (i, j).

6
bi akj
(a) Prove that b0i = aij and that for all k ∈ {1, . . . , m} where k 6= i, b0k = bk − aij bi .
cj
(b) Prove that for all k ∈ {1, . . . , n} we have −c0k = −ck + aij aik .
cj
(c) Prove that z̄ 0 = z̄ + aij bi .

Solution: M 0 is obtained from M as follows (we are just applying the definition of pivoting),

0 1
Mi,• = Mi,• , (1)
aij
0 cj
M0,• = M0,• + Mi,• , (2)
aij
and for every k ∈ {1, . . . , m} where k 6= i we have
0 akj
Mk,• = Mk,• − Mi,• . (3)
aij

Use (1) and (3) to prove (a). Use (2) to prove (b) and (c).

Problem 6: Tableaux – II
(a) Show that for the Primal Simplex the choice of the entering and leaving element will guarantee that
the new basis is primal feasible.

(b) Show that for the Dual Simplex the choice of the entering and leaving element will guarantee that
the new basis is dual feasible.

(c) Show that for the Primal Simplex the value z̄ does not decrease from one iteration to the next.

(d) Show that for the Dual Simplex the value z̄ does not increase from one iteration to the next.

(e) Discuss if what you proved in (a)-(d) makes sense.

Solution: Let (P), (P’), M and M 0 defined as in Problem 4. Assume that (P) is in canonical form for
some basis B.
Recall the rule for selecting the pivot element (i, j) of M for the Primal Simplex,
n o
(R1) pick j such that cj > 0 and pick i = k for k that attains the minimum in min abkj
k
: k with akj > 0 .

Recall the rule for selecting the pivot element (i, j) of M for the Dual Simplex,
n o
ck
(R2) pick i such that bi < 0 and pick j = k for k that attains the minimum in min aik : k with aik < 0 .

(a) Since B is primal feasible we have b ≥ 0. We need to show that b0 ≥ 0. If k = i then Problem
5(a) states that b0i = abiji . Since bi ≥ 0 and by (R1) aij > 0 we have b0i ≥ 0 as required. If k =
6 i then
a
Problem 5(a) states that b0k = bk − akj ij
bi . Suppose first that akj < 0. Then as bk ≥ 0, aij > 0 by (R1) and
bi ≥ 0, we have bk ≥ 0 as required. Thus we may assume that akj > 0 and checking if b0k ≥ 0 is equivalent
0

to checking if abkj
k
≥ abiji , but this is indeed the case because of (R1).
(b) We need to show that c0k ≤ 0 for every k ∈ {1, . . . , n}. By Problem 5(b) for every k ∈ {1, . . . , n} we
c
have −c0k = −ck + aijj aik . Suppose first that aik ≥ 0. Then as −ck ≥ 0 and cj ≤ 0, aij < 0 by (R2) we
have −c0k ≥ 0, as required. Thus we may assume that aik < 0. Now checking if −c0k ≥ 0 is equivalent to
c
checking if aijj ≤ acik
k
which is indeed the case because of (R2).

7
c
(c) and (d) By Problem 5(c) z̄ 0 = z̄ + aijj bi . For the Primal Simplex we have bi ≥ 0, cj > 0 and aij > 0
which implies that z̄ 0 ≥ z̄. For the Dual Simplex we have bi < 0, cj ≤ 0 and aij < 0 which implies that
z̄ 0 ≤ z̄.
(e) (a) implies that if B is a primal feasible basis and we follow (R1), then the basis at the next iteration
will be primal feasible. If this were not the case then the Primal Simplex would not work as described.
(c) implies that at each iteration the value of basic solution corresponding to the basis can stay the same
or increase. This makes sense as we are trying to solve the primal problem which is a maximization
problem. (b) implies that if B is a dual feasible solution and we follow (R2) then the basis at the next
iteration will be dual feasible. If this were not the case then the Dual Simplex would not work as
described. (d) implies that at each iteration the value of the dual solution y corresponding to the basis
can stay the same or decrease. This makes sense as we are trying to solve the dual problem which is a
minimization problem.
Hint: Use Problem 5 and the pivoting rule for the primal and dual Simplex algorithm.

Problem 7: Parametrix programming


An investor has 5$ to invest in BBB. Sheep Inc. (Stock 1) and TT. Star Inc. (Stock 2). The total return
of investing $x1 and $x2 in Stock 1 and Stock 2, respectively, is 6x1 + 2x2 , and the risk associated with it
is 2x1 + x2 . The investor does not want to incur more than 6 units of risk, so she solves the following LP,
max 6x1 + 2x2
such that
2x1 + x2 ≤ 6
x1 + x2 ≤ 5
x1 , x2 ≥ 0
Adding slack variables x3 , x4 to put the LP in SEF and solving we obtain the following Tableau,
 
1 0 1 3 0 18
 0 1 12 1
2 0 3 
 

0 0 12 − 21 1 2

(a) The investor wants to see what happens to the total return when she changes her risk level, i.e. she
wants to find the solution for the following LP for all values of Θ,
max 6x1 + 2x2
such that
2x1 + x2 ≤ 6 + Θ
x1 + x2 ≤ 5
x1 , x2 ≥ 0
• Use parametric programming to plot the optimal total return value as a function of Θ.
• Label regions where the LP is infeasible/unbounded.

Solution: Denote by g(Θ) the optimal value of the parametric LP for value Θ. The tableau for
basis B = {1, 4} of (PΘ ) is given by,
 
1 0 1 3 0 18 + 3Θ
 0 1 12 1
0 3 + Θ 12 
 
2
0 0 12 − 12 1 2 − Θ 12

8
where y = (3, 0)> . For Θ ∈ [−6, 4], B = {1, 4} is optimal and g(Θ) = 18 + 3Θ.

Case 1: Θ < −6.


In that case (PΘ ) is infeasible as the first constraint says: x1 + 21 x2 + 12 x3 = 3 + 12 Θ, and the LHS
must be non-negative while the RHS is negative.

Case 2: Θ > 4.
We do an iteration of the dual simplex and pivot on element (2, 3) to get the following new tableau,
 
1 0 4 0 6 30
 0 1 1 0 1 5
 

0 0 −1 1 −2 −4 + Θ

For Θ ≥ 4, B = {1, 3} is optimal and g(Θ) = 30. We omit a plot of the function g.

(b) Suppose that the returns on either stock are uncertain, but they are negatively correlated to each
other. Specifically, if the return on Stock 1 changes by α, then the return on Stock 2, changes by
−2α. In other words we want to solve the following LP for all values of α,

max (6 + α)x1 + (2 − 2α)x2


such that
2x1 + x2 ≤ 6
x1 + x2 ≤ 5
x1 , x2 ≥ 0

• Use parametric programming to plot the optimal total return value as a function of α.
• Label regions where the LP is infeasible/unbounded.

Solution: Denote by f (α) the optimal value of the parametric LP for value α. The tableau for
basis B = {1, 4} of (Pα ) is given by,

1 0 1 + 52 α 3 + 12 α 0 18 + 3α
 
1 1
 0 1 0 3
 
2 2 
1
0 0 2 − 12 1 2

where y = (3 + 12 α, 0)> . For α ≥ − 25 then B = {1, 4} remains optimal and g(α) = 18 + 3α.

Case 1: α < − 25 .
We do an iteration of the primal simplex and pivot on element (2, 2) to get the following new tableau,
 
1 0 0 4 + 3α −2 − 5α 14 − 7α
 0 1 0 1 −1 1
 

0 0 1 −1 2 4

For α ∈ [− 43 , − 52 ], B = {1, 2} remains optimal and g(α) = 14 − 7α.

Case 2: α < − 34 .

9
We do an iteration of the primal simplex and pivot on element (1, 3) to get the following new tableau,
 
1 −4 − 3α 0 0 2 − 2α 10 − 10α
 0 1 0 1 −1 1
 

0 1 1 0 1 5

For α ≤ − 43 , B = {2, 3} remains optimal and g(α) = 10 − 10α. We omit a plot of the function f .

10

You might also like