Primal Simplex (for a linear program in standard form)

advertisement

ISYE 6669A, Deterministic Optimization

Exam I Solutions

INSTRUCTIONS

Work alone. Do not collaborate with or copy from anyone else.

You may NOT use a calculator for this exam; all computations should be easy enough to do by hand.

Answer all four questions. The extra credit question is optional. Show your work, so that I can give you partial credit if you don’t get the correct answer.

Actually, there was no extra credit question. I wrote one initially, but decided the exam was long/hard enough without it.

 When asked to explain “why”, you may keep your answers brief – the questions are designed so that you do not need to provide long answers.

 The exam is “closed-book”. You may not refer to any books, notes, or other materials during class, aside from the exam materials themselves.

Good luck!

Primal Simplex (for a linear program in standard form)

1.

Begin with a basis B such that x

B

= B

-1 b

0. If no such basis exists, then stop; the problem is infeasible.

2.

Choose a variable x k

such that c k

– c

B

B

-1

– c

B

B

-1 a k

0 (for a maximization problem) or c a k

0 (for a minimization problem). If none exists, then stop; B is the k optimal basis. a.

From among all j such that (B

-1 a k

) j

> 0, let i be the one with the minimum ratio of (B

-1 b) j

/ (B

-1 a k

) j

. (The minimum ratio therefore will have the value

(B

-1 b) j

/ (B

-1 a k

) j

.) If there is no j with (B

-1 a k

) j

> 0, then stop; the problem is unbounded. b.

Update the set of basic variables: the variables will be the same, except that x k

is the new i th basic variable. c.

Create the matrix E as follows. Except for the i th

column, E is the same as the identity matrix. The i th

Every other row j of the i th

row of the i th

column has the value 1 / (B

column has the value

(B

-1 a j

) i

/ (B

-1 a k

) i

.

-1 a k

) i

. d.

Update B

-1

: B

-1 new

= E B

-1 old

. Return to step 2.

Dual Simplex (for a linear program in standard form)

1.

Begin with a basis B such that uA

c (for a primal maximization problem) or uA

c (for a primal minimization problem). If no such basis exists, then stop; the problem is either unbounded or infeasible.

2.

Choose a row i such that (B

-1 b) i

< 0. If none exists, then stop; B is the optimal basis. a.

From among all variables x j

such that (B

-1 a j

) i

< 0, let x k

be the variable with the minimum ratio of | (c j

– c

B

B

-1 a j

) / (B

-1 a j

) i

|. (The minimum ratio therefore will have the value | (c k

– c

B

B

-1 a k

) / (B

-1 a k

) i

|.) If there is no j with (B -1 a j

) i

< 0, then stop; the problem is infeasible. b.

Update the set of basic variables: the variables will be the same, except that x k

is the new i th basic variable. c.

Create the matrix E as follows. Except for the i th

column, E is the same as the identity matrix. The i th

Every other row j of the i th

row of the i th

column has the value 1 / (B

column has the value

(B

-1 a j

) i

/ (B

-1 a k

) i

.

-1 a k

) i

. d.

Update B

-1

: B

-1 new

= E B

-1 old

. Return to step 2.

1.

(25 points) A certain aquarium has a shark tank with S sharks. Because there are many species and ages (and both sexes) of shark, each individual shark needs to be fed differently. The aquarium staff lists N nutrients that sharks need, and each shark i requires a minimum of l ij

pounds of each nutrient j per day. However, overfeeding sharks is also bad; each shark i can be fed no more than u ij

pounds of each nutrient j per day.

The sharks are fed a combination of F foods (brine shrimp, different types of fish, etc.) each day. Each pound food k contains a kj

pounds of each nutrient j , and costs d k

dollars.

The aquarium staff would like to find the cheapest combination of foods to feed its sharks each day, while satisfying each shark’s requirements. To ensure that each shark eats the correct food, the sharks are hand-fed by divers.

Formulate a linear program that the aquarium can use to achieve its goal.

Variables: Let x ik

be the amount of food k purchased each day for shark i.

F S

Minimize

d k

(

x ik

)

k=1 i=1

F

Subject to

a kj

x ik

u ij

k=1

F

a kj

x ik

l ij

k=1 x ik

0

For each shark i, for each nutrient j.

For each shark i, for each nutrient j.

For each shark i, for each food k.

2.

Consider the following linear program and its dual:

Maximize 40 x

1

+ 60 x

2 x

1

0 x

2

0

Minimize 135 u

1

+ 200 u

2

+ 300 u

3

Subject to 3x

1

+ 3x

2

135

6 x

1

+ 4 x

2

200

5 x

1

+ 10 x

2

300

Subject to 3 u

1

+ 6 u

2

+ 5 u

3

40

3 u

1

+ 4 u

2

+ 10 u

3

60 u u

1

2

0

0 u

3

0

(a) (10 points) Explain why the dual constraints are

constraints.

The primal variable is

0, so when the right-hand side of the dual constraint goes up the objective will too. Since we’re minimizing, that means it gets

worse, so the constraint must get harder to satisfy. Therefore, it must be a

 constraint.

(b) (10 points) After solving the problems, we get the following optimal solutions: x

1

= 20 x

2

= 20 u

1

= 0 u

2

= 2.5

u

3

= 5

If the current primal optimal objective value is $2,000, what will the new primal optimal objective value be when the right-hand side of the third primal constraint is raised to 302? (Assume it is within the allowable range.)

Since the dual variables are equal to the primal shadow prices, the shadow price of the third primal constraint is 5. We are changing the right-hand side by 2. So, the answer is $2,000 + 2*5 = $2010.

(c) (10 points) List all of the primal and dual variables whose reduced costs must be zero at the solution of part (b).

Every basic variable has zero reduced cost. x

1

and x

2

in the primal, and u

2 and u

3

in the dual must be basic because they are nonzero.

3.

Answer each of the following questions, and explain your answer briefly (one sentence is okay).

(a) (10 points) After solving a linear program, one of the objective coefficients changes and the problem needs to be re-solved. Which method would you recommend, primal simplex or dual simplex? Why?

The solution is still primal feasible (we have changed c, but not A or b), but might not be dual feasible. Therefore, we should use primal simplex.

(b) (10 points) A linear program has 100,000 constraints (all

constraints) and 100 variables (all

0). Which problem do you think will be faster to solve, this linear program or its dual? Why?

When we put the primal problem in standard form, we will have 100,000 equality constraints, so B and B -1 will be 100,000 x 100,000 matrices. The standard form dual problem will have 100 equality constraints, so B and B -1 will be 100 x 100 matrices. Obviously, inverting the dual matrix will be

MUCH faster than inverting the primal matrix.

(c) (10 points) Suppose we have the following linear program and its dual:

4.

P: Maximize cx

Subject to Ax

b x

0

D: Minimize ub

Subject to uA

c u

0

Show algebraically OR explain logically why it must be true that the objective value of any primal feasible solution must be less than or equal to the objective value of any dual feasible solution.

Algebraic reason:

If a solution x is primal feasible, Ax

b. Since u

0, multiplying u by both sides of the primal constraint gives uAx

ub.

If a solution u is dual feasible, uA

c. Since x

0, multiplying x by both sides of the dual constraint gives uAx

cx.

Putting the two together gives cx

uAx

ub, so cx

ub.

Logical reason I:

If you start from the fact that the optimal objective values of the primal and dual are equal, we know any primal feasible solution is less than or equal to that value (since we’re maximizing the primal), and any dual feasible solution is greater than or equal to that value

(since we’re minimizing the dual). Therefore, any primal feasible solution value must be less than or equal to any dual feasible solution value.

Logical reason II:

Think of how we interpreted the dual of the Farmer Jane problem – the dual objective is the amount we need to pay in order to buy her out. If the dual objective was less than the primal objective, it would mean we would need to pay less than Jane could get by operating the farm – that doesn’t make sense. Therefore, the dual objective must be

the primal objective.

Either one of these two answers was okay.

(10 points) Suppose you were given the following linear program:

Minimize cx

Subject to Ax

b

0

x

h

Let h be a vector of positive integers, and let A be a m x n matrix ( n

 m ).

At the optimal basic solution, what is the largest number of variables that would not have integer values? Why?

This question was a hard one, designed to make you think slightly beyond what we’ve talked about in class.

At a basic solution, we must have n constraints satisfied at equality. At most

m of those will be the Ax

b constraints, leaving nm. Therefore, nm of the constraints x

0 or x

h must also be satisfied at equality.

For any variable x j

, we can’t satisfy both x j

=0 and x j

=h (since h > 0), so the n

m constraints must each involve a different variable. All of those n m variables must therefore have integer values, so only m variables are left to have non-integer values.

This property is very useful when trying to solve integer programs where the number of variables n is large but the number of constraints m is small.

Download