• Nem Talált Eredményt

Complementary slackness

In document Application of linear programming (Pldal 44-49)

Recall that strong duality theorem says that if xis an optimal solution to the primal and y is an optimal solution to the dual, thencTx=bTy. In fact, more is true.

Theorem 3.3 (Complementary slackness) Assume that x is an optimal solution to the primal.

Then

1. Ifyis anoptimalsolution to the dual, thenxandyarecomplementary.

2. Ifyis afeasiblesolution in the dual and iscomplementarytox, thenyisoptimalin the dual.

3. Thereexists a feasiblesolutionyto the dual such thatxandyarecomplementary.

A consequence is of this theorem is the following.

Proposition 3.2 If x is a basic feasible primal solution and π is the vector contains the corre-sponding shadow prices, thenxis optimal if and only ifπis a feasible solution of the dual.

To understand the relevance of Theorem3.3let us consider the following LP:

max z = 6x1 + x2 − x3 − x4 x1 + 2x2 + x3 + x4 ≤5 3x1 + x2 − x3 ≤8 x2 + x3 + x4 = 1

x1 unrestricted x2, x3, x4 ≥0

We would like to check if one of the following assignments is an optimal solution

1. x1 = 2, x2 = 1, x3 = 0, x4 = 0 2. x1 = 3, x2 = 0, x3 = 1, x4 = 0 To check this, we need the dual LP:

min w= 5y1 + 8y2 + y3

y1 + 3y2 = 6

2y1 + y2 + y3 ≥1 y1 − y2 + y3 ≥ −1

y1 + y3 ≥ −1

y1, y2 ≥0

y3 unrestricted

Thefirst suggestionis: x1 = 2, x2 = 1, x3 = 0, x4 = 0; suppose that this is optimal. Then there is ay = (y1, y2, y3)feasible solution that is complementary tox.

• the first primal constraint: x1+ 2x2+x3+x4 = 2 + 2 + 0 + 0 = 4 <5not tight→y1 = 0

• the second primal constraint:3x1+x2−x3 = 6 + 1−0 = 7 <8not tight→y2 = 0

• then the first dual constraint: y1 + 3y2 = 0 + 0 = 06= 6→(y1, y2, y3)not feasiblesolution of the dual, but we assumed that it is⇒xnot optimalsolution of the primal

Thesecond suggestionis: x1 = 3, x2 = 0, x3 = 1, x4 = 0; suppose that this is optimal. hen there is ay= (y1, y2, y3)feasible solution that is complementary tox.

• the first primal constraintx1+ 2x2+x3+x4 = 3 + 0 + 1 + 0 = 4<5not tight→y1 = 0

• the second primal constraint:3x1+x2−x3 = 9 + 0−1 = 8tight

• the third primal constraint:x2+x3+x4 = 0 + 1 + 0 = 1tight

• check sign constraints (x1, x2, x3, x4 ≥0)⇒xfeasiblein the primal Now check the values inxwith respect to the dual constraints

• x1is unbounded→the first dual constrainty1+ 3y2 = 6is tight(by necessity)

• x3 >0→the third dual constraint istight:y1−y2+y3 =−1

Summarizing the above we get:

y1 = 0

y1 + 3y2 = 6

y1 − y2 + y3 =−1

The unique solution of this system is: y1 = 0, y2 = 2, y3 = 1; this is complementary to x = (x1, x2, x3, x4) by construction. The last step is to check if y is also feasible in the dual. The answer is true, thusxisoptimal solutionof the primal.

3.5.1 Complementary slackness: summary

1. Givenx, check ifxis feasible;

2. find which variablesy1 should be0;

3. find which dual constraints should be tight;

4. this yields a system of equations;

5. solve the system;

6. verify that the solution is feasible in the dual.

If all these steps succeed, then the givenxis optimal; otherwise, it is not.

3.6 Exercises

3.6.1 What is the dual of the following linear programming problem:

max z = 2x1 + x2

S.t. 2x1 + x2 ≤ 4

2x1 + 3x2 ≤ 3 4x1 + x2 ≤ 5 x1 + 5x2 ≤ 1 x1, x2 ≥ 0

3.6.2 What is the dual of the following linear programming problem:

max z = x1 + 3x2

S.t. −x1 − 3x2 ≤ −3

−x1 + x2 ≤ −1 x1 + 2x2 ≤ 4

x1, x2 ≥ 0 3.6.3 What is the dual of the following linear programming problem:

Max z = 6x1 + 8x2 + 5x3 + 9x4

S.t. x1 + x2 + x3 + x4 = 1

xi ≥ 0 (i= 1,2,3,4) 3.6.4 Find an available LP Solver a check the primal and dual solutions of the above tasks.

3.6.5 (Diet problem). A master student was trying to make ends meet on a very small stipend. He went to the library and looked up “Recommended Dietary Allowances” and was able to determine a minimum daily intake quantity of each essential nutrient for a male in his weight and age category.

Let m denote the number of nutrients that he identified as important to his diet, and let bi for i= 1, . . . , mdenote his personal minimum daily requirements. Next, he made a list of his favorite foods (which, except for pizza and due mostly to laziness and ineptitude in the kitchen, consisted almost entirely of frozen prepared meals). He then went to the local grocery store and made a list of the unit price for each of his favorite foods. Let us denote these prices as cj forj = 1, . . . , n.

In addition to prices, he also looked at the labels and collected information about how much of the critical nutrients are contained in one serving of each food. Let us denote by aij the amount of nutrienticontained in foodj. (Fortunately, he was able to call his favorite pizza delivery service and get similar information from them.)

• In terms of this information, formulate a linear program minimizes the student’s cost.

• Make your on diet. Consider at least 5 nutrients and 7 different foods.

• Formulate the dual of the problem.

• Can you introduce another person into the above story whose problem would naturally be to solve the dual?

Chapter 4

Integer Programming

A (mixed) integer programming problem (IP or MIP) is an LP in which (some) all of the variables are required to be non-negative integers. Many real-life situations may be formulated as IPs and MIPs, but unfortunately, we will in this chapter that IPs are usually much harder to solve than LPs.

We begin with necessary definitions and then present the so-called Branch-and-Bound technique to solve IPs. We also discuss the basics of dynamic programming and some practical solutions that an be formulated as IPs.

4.1 Introduction to IP

An LP in which all variables are required to be integers is called a pure integer programming (IP) problem. For example,

maxz = 3x1 + 2x2

st x1 + x2 ≤ 6

x1, x2 ≥ 0 x1, x2 integer

An IP in which only some of the variables are required to be integers is called amixed integer programming problem(MIP). In the example above letx1, x2 ≥0andx2be an integer (x1is not required to be an integer). An integer programming problem in which all the variables must equal 0or1is called a0−1IP.

The LP obtained by omitting all integer or 0−1constraints on variables is called theLP relaxationof the IP.

Proposition 4.1 The following statements holds.

• The feasible region for any IP must be contained in the feasible region of the corresponding LP relaxation.

• Optimal objective function value for LP relaxation≥ optimal value for IP (for max prob-lems).

• If all corner points of the feasible region of the LP- relaxation is integer, then it has an integer optimal solution that is also optimal solution of the corresponding IP.

• The optimal solution of the LP-relaxation can be arbitrarily far from the IP solution.

In document Application of linear programming (Pldal 44-49)