Linear programming. Starch Proteins Vitamins Cost ($/kg) G G Nutrient content and cost per kg of food.

Similar documents
F 1 F 2 Daily Requirement Cost N N N

Contents. 4.5 The(Primal)SimplexMethod NumericalExamplesoftheSimplexMethod

II. Analysis of Linear Programming Solutions

The Simplex Algorithm

1. Algebraic and geometric treatments Consider an LP problem in the standard form. x 0. Solutions to the system of linear equations

Example. 1 Rows 1,..., m of the simplex tableau remain lexicographically positive

Simplex Algorithm Using Canonical Tableaus

OPERATIONS RESEARCH. Linear Programming Problem

Ω R n is called the constraint set or feasible set. x 1

Review Solutions, Exam 2, Operations Research

9.1 Linear Programs in canonical form

4.5 Simplex method. LP in standard form: min z = c T x s.t. Ax = b

Part 1. The Review of Linear Programming

The dual simplex method with bounds

Lectures 6, 7 and part of 8

Lecture 4: Algebra, Geometry, and Complexity of the Simplex Method. Reading: Sections 2.6.4, 3.5,

Yinyu Ye, MS&E, Stanford MS&E310 Lecture Note #06. The Simplex Method

"SYMMETRIC" PRIMAL-DUAL PAIR

In Chapters 3 and 4 we introduced linear programming

CSCI 1951-G Optimization Methods in Finance Part 01: Linear Programming

A Review of Linear Programming

OPTIMISATION 3: NOTES ON THE SIMPLEX ALGORITHM

Linear Programming Duality P&S Chapter 3 Last Revised Nov 1, 2004

An introductory example

Lecture 2: The Simplex method

1 Review Session. 1.1 Lecture 2

Chapter 1: Linear Programming

AM 121: Intro to Optimization Models and Methods

Developing an Algorithm for LP Preamble to Section 3 (Simplex Method)

4. Duality and Sensitivity

CO350 Linear Programming Chapter 8: Degeneracy and Finite Termination

Chapter 5 Linear Programming (LP)

AM 121: Intro to Optimization

Duality Theory, Optimality Conditions

Simplex Method for LP (II)

Linear Programming, Lecture 4

4.5 Simplex method. min z = c T x s.v. Ax = b. LP in standard form

Part 1. The Review of Linear Programming

LP. Lecture 3. Chapter 3: degeneracy. degeneracy example cycling the lexicographic method other pivot rules the fundamental theorem of LP

4. Duality Duality 4.1 Duality of LPs and the duality theorem. min c T x x R n, c R n. s.t. ai Tx = b i i M a i R n

4.6 Linear Programming duality

Standard Form An LP is in standard form when: All variables are non-negativenegative All constraints are equalities Putting an LP formulation into sta

THE UNIVERSITY OF HONG KONG DEPARTMENT OF MATHEMATICS. Operations Research I

Introduction to Mathematical Programming IE406. Lecture 10. Dr. Ted Ralphs

IE 400: Principles of Engineering Management. Simplex Method Continued

Linear Programming. Linear Programming I. Lecture 1. Linear Programming. Linear Programming

Summary of the simplex method

OPRE 6201 : 3. Special Cases

Lecture slides by Kevin Wayne

Relation of Pure Minimum Cost Flow Model to Linear Programming

IE 400 Principles of Engineering Management. The Simplex Algorithm-I: Set 3

3 Development of the Simplex Method Constructing Basic Solution Optimality Conditions The Simplex Method...

LINEAR PROGRAMMING I. a refreshing example standard form fundamental questions geometry linear algebra simplex algorithm

Lecture: Algorithms for LP, SOCP and SDP

TRANSPORTATION PROBLEMS

Motivating examples Introduction to algorithms Simplex algorithm. On a particular example General algorithm. Duality An application to game theory

The simplex algorithm

IE 5531: Engineering Optimization I

Dr. S. Bourazza Math-473 Jazan University Department of Mathematics

CHAPTER 2. The Simplex Method

MATH 445/545 Test 1 Spring 2016

3.3 Sensitivity Analysis

3 Does the Simplex Algorithm Work?

MATH 4211/6211 Optimization Linear Programming

CSCI5654 (Linear Programming, Fall 2013) Lecture-8. Lecture 8 Slide# 1

Linear Programming Redux

CO350 Linear Programming Chapter 6: The Simplex Method

Week 2. The Simplex method was developed by Dantzig in the late 40-ties.

The Simplex Algorithm and Goal Programming

MAT016: Optimization

MATH 373 Section A1. Final Exam. Dr. J. Bowman 17 December :00 17:00

Slack Variable. Max Z= 3x 1 + 4x 2 + 5X 3. Subject to: X 1 + X 2 + X x 1 + 4x 2 + X X 1 + X 2 + 4X 3 10 X 1 0, X 2 0, X 3 0

3 The Simplex Method. 3.1 Basic Solutions

Chap6 Duality Theory and Sensitivity Analysis

Linear Programming in Matrix Form

CO 602/CM 740: Fundamentals of Optimization Problem Set 4

Farkas Lemma, Dual Simplex and Sensitivity Analysis

Introduce the idea of a nondegenerate tableau and its analogy with nondenegerate vertices.

The Primal-Dual Algorithm P&S Chapter 5 Last Revised October 30, 2006

M340(921) Solutions Problem Set 6 (c) 2013, Philip D Loewen. g = 35y y y 3.

3. THE SIMPLEX ALGORITHM

Dr. Maddah ENMG 500 Engineering Management I 10/21/07

Distributed Real-Time Control Systems. Lecture Distributed Control Linear Programming

MATH2070 Optimisation

Appendix PRELIMINARIES 1. THEOREMS OF ALTERNATIVES FOR SYSTEMS OF LINEAR CONSTRAINTS

Linear Programming. Murti V. Salapaka Electrical Engineering Department University Of Minnesota, Twin Cities

Simplex method(s) for solving LPs in standard form

Lecture 11: Post-Optimal Analysis. September 23, 2009

3. Linear Programming and Polyhedral Combinatorics

Section Notes 9. IP: Cutting Planes. Applied Math 121. Week of April 12, 2010

Introduction to Mathematical Programming

Math 273a: Optimization The Simplex method

ORF 522. Linear Programming and Convex Analysis

Today: Linear Programming (con t.)

Math Models of OR: Some Definitions

(P ) Minimize 4x 1 + 6x 2 + 5x 3 s.t. 2x 1 3x 3 3 3x 2 2x 3 6

Linear Programming Duality

A Parametric Simplex Algorithm for Linear Vector Optimization Problems

Linear & Integer programming

Midterm Review. Yinyu Ye Department of Management Science and Engineering Stanford University Stanford, CA 94305, U.S.A.

Transcription:

18.310 lecture notes September 2, 2013 Linear programming Lecturer: Michel Goemans 1 Basics Linear Programming deals with the problem of optimizing a linear objective function subject to linear equality and inequality constraints on the decision variables. Linear programming has many practical applications (in transportation, production planning,...). It is also the building block for combinatorial optimization. One aspect of linear programming which is often forgotten is the fact that it is also a useful proof technique. In this first chapter, we describe some linear programming formulations for some classical problems. We also show that linear programs can be expressed in a variety of equivalent ways. 1.1 Formulations 1.1.1 The Diet Problem In the diet model, a list of available foods is given together with the nutrient content and the cost per unit weight of each food. A certain amount of each nutrient is required per day. For example, here is the data corresponding to a civilization with just two types of grains (G1 and G2) and three types of nutrients (starch, proteins, vitamins): Starch Proteins Vitamins Cost ($/kg) G1 5 4 2 0.6 G2 7 2 1 0.35 Nutrient content and cost per kg of food. The requirement per day of starch, proteins and vitamins is 8, 15 and 3 respectively. The problem is to find how much of each food to consume per day so as to get the required amount per day of each nutrient at minimal cost. When trying to formulate a problem as a linear program, the first step is to decide which decision variables to use. These variables represent the unknowns in the problem. In the diet problem, a very natural choice of decision variables is: x 1 : number of units of grain G1 to be consumed per day, x 2 : number of units of grain G2 to be consumed per day. The next step is to write down the objective function. The objective function is the function to be minimized or maximized. In this case, the objective is to minimize the total cost per day which is given by z =0.6x 1 +0.35x 2 (the value of the objective function is often denoted by z). Finally, we need to describe the different constraints that need to be satisfied by x 1 and x 2. First of all, x 1 and x 2 must certainly satisfy x 1 0andx 2 0. Only nonnegative amounts of LP-1

food can be eaten! These constraints are referred to as nonnegativity constraints. Nonnegativity constraints appear in most linear programs. Moreover, not all possible values for x 1 and x 2 give rise to a diet with the required amounts of nutrients per day. The amount of starch in x 1 units of G1 and x 2 units of G2 is 5x 1 +7x 2 and this amount must be at least 8, the daily requirement of starch. Therefore, x 1 and x 2 must satisfy 5x 1 +7x 2 8. Similarly, the requirements on the amount of proteins and vitamins imply the constraints 4x 1 +2x 2 15 and 2x 1 + x 2 3. This diet problem can therefore be formulated by the following linear program: Minimize z =0.6x 1 +0.35x 2 5x 1 +7x 2 8 4x 1 +2x 2 15 2x 1 + x 2 3 x 1 0,x 2 0. Some more terminology. A solution x =(x 1,x 2 ) is said to be feasible with respect to the above linear program if it satisfies all the above constraints. The set of feasible solutions is called the feasible space or feasible region. A feasible solution is optimal if its objective function value is equal to the smallest value z can take over the feasible region. 1.1.2 The Transportation Problem Suppose a company manufacturing widgets has two factories located at cities F1 and F2 and three retail centers located at C1, C2 and C3. The monthly demand at the retail centers are (in thousands of widgets) 8, 5 and 2 respectively while the monthly supply at the factories are 6 and 9 respectively. Notice that the total supply equals the total demand. We are also given the cost of transportation of 1 widget between any factory and any retail center. C1 C2 C3 F1 5 5 3 F2 6 4 1 Cost of transportation (in 0.01$/widget). In the transportation problem, the goal is to determine the quantity to be transported from each factory to each retail center so as to meet the demand at minimum total shipping cost. In order to formulate this problem as a linear program, we first choose the decision variables. Let x ij (i =1, 2andj =1, 2, 3) be the number of widgets (in thousands) transported from factory Fi to city Cj. Given these x ij s, we can express the total shipping cost, i.e. the objective function to be minimized, by 5x 11 +5x 12 +3x 13 +6x 21 +4x 22 + x 23. We now need to write down the constraints. First, we have the nonnegativity constraints saying that x ij 0fori =1, 2andj =1, 2, 3. Moreover, we have that the demand at each retail center must be met. This gives rise to the following constraints: x 11 + x 21 =8, LP-2

x 12 + x 22 =5, x 13 + x 23 =2. Finally, each factory cannot ship more than its supply, resulting in the following constraints: x 11 + x 12 + x 13 6, x 21 + x 22 + x 23 9. These inequalities can be replaced by equalities since the total supply is equal to the total demand. A linear programming formulation of this transportation problem is therefore given by: Minimize 5x 11 +5x 12 +3x 13 +6x 21 +4x 22 + x 23 x 11 + x 21 =8 x 12 + x 22 =5 x 13 + x 23 =2 x 11 + x 12 + x 13 =6 x 21 + x 22 + x 23 =9 x 11 0,x 21 0,x 31 0, x 12 0,x 22 0,x 32 0. Among these 5 equality constraints, one is redundant, i.e. it is implied by the other constraints or, equivalently, it can be removed without modifying the feasible space. For example, by adding the first 3 equalities and substracting the fourth equality we obtain the last equality. Similarly, by adding the last 2 equalities and substracting the first two equalities we obtain the third one. 1.2 Representations of Linear Programs A linear program can take many different forms. First, we have a minimization or a maximization problem depending on whether the objective function is to be minimized or maximized. The constraints can either be inequalities ( or ) or equalities. Some variables might be unrestricted in sign (i.e. they can take positive or negative values; this is denoted by 0) while others might be restricted to be nonnegative. A general linear program in the decision variables x 1,...,x n is therefore of the following form: Maximize or Minimize z = c 0 + c 1 x 1 +...+ c n x n a i1 x 1 + a i2 x 2 +...+ a in x n b i = { 0 x j 0 i =1,...,m j =1,...,n. The problem data in this linear program consists of c j (j =0,...,n), b i (i =1,...,m)anda ij (i =1,...,m, j =1,...,n). c j is referred to as the objective function coefficient of x j or, more LP-3

simply, the cost coefficient of x j. b i is known as the right-hand-side (RHS) of equation i. Notice that the constant term c 0 can be omitted without affecting the set of optimal solutions. A linear program is said to be in standard form if it is a maximization program, there are only equalities (no inequalities) and all variables are restricted to be nonnegative. In matrix form, a linear program in standard form can be written as: Max z = c T x Ax = b x 0. where c1 b1. x1 c =.,b=.,x=. c n are column vectors, c T denote the transpose of the vector c, anda =[a ij ]isthem n matrix whose i, j element is a ij. Any linear program can in fact be transformed into an equivalent linear program in standard form. Indeed, b m If the objective function is to minimize z = c 1 x 1 +...+ c n x n then we can simply maximize z = z = c 1 x 1... c n x n. If we have an inequality constraint a i1 x 1 +...+ a in x n b i then we can transform it into an equality constraint by adding a slack variable, say s, restricted to be nonnegative: a i1 x 1 +...+ a in x n + s = b i and s 0. Similarly, if we have an inequality constraint a i1 x 1 +...+ a in x n b i then we can transform it into an equality constraint by adding a surplus variable, say s, restricted to be nonnegative: a i1 x 1 +...+ a in x n s = b i and s 0. x n If x j is unrestricted in sign then we can introduce two new decision variables x + j restricted to be nonnegative and replace every occurrence of x j by x + j x j. For example, the linear program and x j Minimize z =2x 1 x 2 x 1 + x 2 2 3x 1 +2x 2 4 x 1 +2x 2 =3 x 1 0,x 2 0. LP-4

is equivalent to the linear program Maximize z = 2x + 1 +2x 1 + x 2 x + 1 x 1 + x 2 x 3 =2 3x + 1 3x 1 +2x 2 + x 4 =4 x 1 +2x 2 =3 x + 1 + x 1 0,x 1 0,x 2 0,x 3 0,x 4 0. with decision variables x + 1,x 1,x 2,x 3,x 4. Notice that we have introduced different slack or surplus variables into different constraints. In some cases, another form of linear program is used. A linear program is in canonical form if it is of the form: Max z = c T x Ax b x 0. A linear program in canonical form can be replaced by a linear program in standard form by just replacing Ax b by Ax + Is = b, s 0wheres is a vector of slack variables and I is the m m identity matrix. Similarly, a linear program in standard form can [ be replaced ] by( a linear ) program A b in canonical form by replacing Ax = b by A x b where A = and b A =. b 2 The Simplex Method In 1947, George B. Dantzig developed a technique to solve linear programs this technique is referred to as the simplex method. 2.1 Brief Review of Some Linear Algebra Two systems of equations Ax = b and Ax = b are said to be equivalent if {x : Ax = b} = {x : Ax = b}. Let E i denote equation i of the system Ax = b, i.e. a i1 x 1 +...+ a in x n = b i. Given a system Ax = b, anelementary row operation consists in replacing E i either by αe i where α is a nonzero scalarorbye i + βe k for some k = i. Clearly, if Ax = b is obtained from Ax = b by an elementary row operation then the two systems are equivalent. (Exercise: prove this.) Notice also that an elementary row operation is reversible. Let a rs be a nonzero element of A. Apivotona rs consists of performing the following sequence of elementary row operations: replacing E r by E r = 1 a rs E r, for i =1,...,m, i = r, replacing E i by E i = E i a is E r = E i a is E r. a rs LP-5

After pivoting on a rs, all coefficients in column s are equal to 0 except the one in row r which is now equal to 1. Since a pivot consists of elementary row operations, the resulting system Ax = b is equivalent to the original system. Elementary row operations and pivots can also be defined in terms of matrices. Let P be an m m invertible (i.e. P 1 exists 1 ) matrix. Then {x : Ax = b} = {x : PAx = Pb}. Thetwotypes of elementary row operations correspond to the matrices (the coefficients not represented are equal to 0): 1 1...... 1 1 β i P = α i and P =.... 1 1 k...... 1 1 Pivoting on a rs corresponds to premultiplying Ax = b by 1 a1s /a rs... 1 a r 1,s /ars P = 1/a rs r. a r+1,s /a rs 1... a ms /a rs 1 2.2 The Simplex Method on an Example For simplicity, we shall assume that we have a linear program of (what seems to be) a rather special form (we shall see later on how to obtain such a form): the linear program is in standard form, b 0, there exists a collection B of m variables called a basis such that the submatrix A B of A consisting of the columns of A corresponding to the variables in B is the m m identity matrix and the cost coefficients corresponding to the variables in B are all equal to 0. For example, the following linear program has this required form: 1 This is equivalent to saying that det P = 0 or also that the system Px =0hasx = 0 as unique solution LP-6

Max z =10+ 20x 1 + 16 x 2 + 12 x 3 subject to x 1 + x 4 = 4 2 x 1 + x 2 + x 3 +x 5 = 10 2 x 1 + 2x 2 + x 3 + x 6 = 16 x 1,x 2,x 3,x 4,x 5,x 6 0. In this example, B = {x 4,x 5,x 6 }. The variables in B are called basic variables while the other variables are called nonbasic. The set of nonbasic variables is denoted by N. In the example, N = {x 1,x 2,x 3 }. The advantage of having A B = I is that we can quickly infer the values of the basic variables given the values of the nonbasic variables. For example, if we let x 1 =1,x 2 =2,x 3 = 3, we obtain x 4 =4 x 1 =3, x 5 =10 2x 1 x 2 x 3 =3, x 6 =16 2x 1 2x 2 x 3 =7. Also, we don t need to know the values of the basic variables to evaluate the cost of the solution. In this case, we have z =10+20x 1 +16x 2 +12x 3 = 98. Notice that there is no guarantee that the so-constructed solution be feasible. For example, if we set x 1 =5,x 2 =2,x 3 =1,wehavethat x 4 =4 x 1 = 1 does not satisfy the nonnegativity constraint x 4 0. There is an assignment of values to the nonbasic variables that needs special consideration. By just letting all nonbasic variables to be equal to 0, we see that the values of the basic variables are just given by the right-hand-sides of the constraints and the cost of the resulting solution is just the constant term in the objective function. In our example, letting x 1 = x 2 = x 3 = 0, we obtain x 4 =4,x 5 =10,x 6 =16andz = 10. Such a solution is called a basic feasible solution or bfs. The feasibility of this solution comes from the fact that b 0. Later, we shall see that, when solving a linear program, we can restrict our attention to basic feasible solutions. The simplex method is an iterative method that generates a sequence of basic feasible solutions (corresponding to different bases) and eventually stops when it has found an optimal basic feasible solution. Instead of always writing explicitely these linear programs, we adopt what is known as the tableau format. First, in order to have the objective function play a similar role as the other constraints, we consider z to be a variable and the objective function as a constraint. Putting all variables on the same side of the equality sign, we obtain: z +20x 1 +16x 2 +12x 3 = 10. We also get rid of the variable names in the constraints to obtain the tableau format: z x 1 x 2 x 3 x 4 x 5 x 6 1 20 16 12-10 1 0 0 1 4 2 1 1 1 10 2 2 1 1 16 Our bfs is currently x 1 =0,x 2 =0,x 3 =0,x 4 =4,x 5 =10,x 6 =16andz = 10. Since the cost coefficient c 1 of x 1 is positive (namely, it is equal to 20), we notice that we can increase z by increasing x 1 and keeping x 2 and x 3 at the value 0. But in order to maintain feasibility, we must LP-7

have that x 4 =4 x 1 0, x 5 =10 2x 1 0, x 6 =16 2x 1 0. This implies that x 1 4. Letting x 1 =4,x 2 =0,x 3 = 0, we obtain x 4 =0,x 5 =2,x 6 = 8 and z = 90. This solution is also a bfs and corresponds to the basis B = {x 1,x 5,x 6 }.Wesaythatx 1 has entered the basis and, as a result, x 4 has left the basis. We would like to emphasize that there is a unique basic solution associated with any basis. This (not necessarily feasible) solution is obtained by setting the nonbasic variables to zero and deducing the values of the basic variables from the m constraints. Now we would like that our tableau reflects this change by showing the dependence of the new basic variables as a function of the nonbasic variables. This can be accomplished by pivoting on the element a 11. Why a 11? Well, we need to pivot on an element of column 1 because x 1 is entering the basis. Moreover, the choice of the row to pivot on is dictated by the variable which leaves the basis. In this case, x 4 is leaving the basis and the only 1 in column 4 is in row 1. After pivoting on a 11, we obtain the following tableau: z x 1 x 2 x 3 x 4 x 5 x 6 1 16 12-20 -90 1 0 0 1 4 1 1-2 1 2 2 1-2 1 8 Notice that while pivoting we also modified the objective function row as if it was just like another constraint. We have now a linear program which is equivalent to the original one from which we can easily extract a (basic) feasible solution of value 90. Still z canbeimprovedby increasing x s for s = 2 or 3 since these variables have a positive cost coefficient 2 c s. Let us choose the one with the greatest c s; in our case x 2 will enter the basis. The maximum value that x 2 can take while x 3 and x 4 remain at the value 0 is dictated by the constraints x 1 =4 0, x 5 =2 x 2 0 and x 6 =8 2x 2 0. The tightest of these inequalities being x 5 =2 x 2 0, we have that x 5 will leave the basis. Therefore, pivoting on ā 22, we obtain the tableau: z x 1 x 2 x 3 x 4 x 5 x 6 1-4 12-16 -122 1 0 1 0 4 1 1-2 1 2-1 2-2 1 4 The current basis is B = {x 1,x 2,x 6 } and its value is 122. Since 12 > 0, we can improve the current basic feasible solution by having x 4 enter the basis. Instead of writing explicitely the constraints on x 4 to compute the level at which x 4 can enter the basis, we perform the min ratio test. Ifx s is the variable that is entering the basis, we compute min b i /ā is. i:ā is >0 { } The argument of the minimum gives the variable that is exiting the basis. In our example, we obtain 2 = min{4/1, 4/2} and therefore variable x 6 which is the basic variable corresponding to row 3 leaves the basis. Moreover, in order to get the updated tableau, we need to pivot on ā 34. Doing so, we obtain: 2 By simplicity, we always denote the data corresponding to the current tableau by c, A, andb. LP-8

z x 1 x 2 x 3 x 4 x 5 x 6 1 2-4 -6-146 1 1/2 1-1/2 2 1 0-1 1 6-1/2 1-1 1/2 2 Our current basic feasible solution is x 1 =2,x 2 =6,x 3 =0,x 4 =2,x 5 =0,x 6 =0withvalue z = 146. By the way, why is this solution feasible? In other words, how do we know that the right-hand-sides (RHS) of the constraints are guaranteed to be nonnegative? Well, this follows from the min ratio test and the pivot operation. Indeed, when pivoting on ā rs, we know that ā rs > 0, b r ā rs b i if ā is > 0. ā is After pivoting the new RHS satisfy b r = br ā rs 0, b ā i = b is b i 0ifā is 0and i ārs ) b i = b i ā is i b =ā r is ā is ārs 0ifā is > 0. ā rs ( b We can also justify why the solution keeps improving. Indeed, when we pivot on ā rs > 0, the constant term c 0 in the objective function becomes c 0 + b r c s/ā rs. If b r > 0, we have a strict improvement in the objective function value since by our choice of entering variable c s > 0. We shall deal with the case b r =0lateron. The bfs corresponding to B = {1, 2, 4} is not optimal since there is still a positive cost coefficient. We see that x 3 can enter the basis and, since there is just one positive element in row 3, we have that x 1 leaves the basis. We thus pivot on ā 13 and obtain: z x 1 x 2 x 3 x 4 x 5 x 6 1-4 -8-4 -154 2 1 2-1 4 0 1-1 1 6 1 1 0 0 4 Thecurrentbasisis{x 3,x 2,x 4 } and the associated bfs is x 1 =0,x 2 =6,x 3 =4,x 4 =4,x 5 = 0,x 6 =0withvaluez = 154. This bfs is optimal since the objective function reads z = 154 4x 1 8x 5 4x 6 and therefore cannot be more than 154 due to the nonnegativity constraints. Through a sequence of pivots, the simplex method thus goes from one linear program to another equivalent linear program which is trivial to solve. Remember the crucial observation that a pivot operation does not alter the feasible region. In the above example, we have not encountered several situations that may typically occur. First, in the min ratio test, several terms might produce the minimum. In that case, we can arbitrarily select one of them. For example, suppose the current tableau is: LP-9

z x 1 x 2 x 3 x 4 x 5 x 6 1 16 12-20 -90 1 0 0 1 4 1 1-2 1 2 2 1-2 1 4 and that x 2 is entering the basis. The min ratio test gives 2 = min{2/1, 4/2} and, thus, either x 5 or x 6 can leave the basis. If we decide to have x 5 leave the basis, we pivot on ā 22 ; otherwise, we pivot on ā 32. Notice that, in any case, the pivot operation creates a zero coefficient among the RHS. For example, pivoting on ā 22, we obtain: z x 1 x 2 x 3 x 4 x 5 x 6 1-4 12-16 -122 1 0 1 0 4 1 1-2 1 2-1 2-2 1 0 A bfs with b i = 0 for some i is called degenerate. A linear program is nondegenerate if no bfs is degenerate. Pivoting now on ā 34 we obtain: z x 1 x 2 x 3 x 4 x 5 x 6 1 2-4 -6-122 1 1/2 1-1/2 4 1 0-1 1 2-1/2 1-1 1/2 0 This pivot is degenerate. A pivot on ā rs is called degenerate if b r = 0. Notice that a degenerate pivot alters neither the b i s nor c 0. In the example, the bfs is (4, 2, 0, 0, 0, 0) in both tableaus. We thus observe that several bases can correspond to the same basic feasible solution. Another situation that may occur is when x s is entering the basis, but ā is 0fori =1,...,m. In this case, there is no term in the min ratio test. This means that, while keeping the other nonbasic variables at their zero level, x s can take an arbitrarily large value without violating feasibility. Since c s > 0, this implies that z can be made arbitrarily large. In this case, the linear program is said to be unbounded or unbounded from above if we want to emphasize the fact that we are dealing with a maximization problem. For example, consider the following tableau: z x 1 x 2 x 3 x 4 x 5 x 6 1 16 12 20-90 1 0 0-1 4 1 1 0 1 2 2 1-2 1 8 If x 4 enters the basis, we have that x 1 =4+x 4, x 5 = 2 and x 6 =8+2x 4 and, as a result, for any nonnegative value of x 4, the solution (4 + x 4, 0, 0,x 4, 2, 8+2x 4 ) is feasible and its objective function value is 90 + 20x 4. There is thus no finite optimum. LP-10

2.3 Detailed Description of Phase II In this section, we summarize the different steps of the simplex method we have described in the previous section. In fact, what we have described so far constitutes Phase II of the simplex method. Phase I deals with the problem of putting the linear program in the required form. This will be described in a later section. Phase II of the simplex method 1. Suppose the initial or current tableau is z x 1... x s... x n 1 c 1... c s... c n c 0 ā 11... ā 1s... ā 1n b1 0.... ā r1... ā rs... ā rn br 0.... ā m1... ā ms... ā mn bm 0 and the variables can be partitioned into B = {x j1,...,x jm } and N with c ji =0fori =1,...,m and { 0 k = i ā kji = 1 k = i. The current basic feasible solution is given by x ji = b i for i =1,...,m and x j =0 otherwise. The objective function value of this solution is c 0. 2. If c j 0 for all j =1,...,n then the current basic feasible solution is optimal. STOP. 3. Find a column s for which c s > 0. x s is the variable entering the basis. 4. Check for unboundedness. If ā is 0fori =1,...,m then the linear program is unbounded. STOP. 5. Min ratio test. Find row r such that b r b i = min. ārs i:ā is> 0 ā is 6. Pivot on ā rs. I.e. replace the current tableau by: LP-11

z... x s... x j... ā rj c s b r c s 1... 0... c j... c 0 ā rs... ā rj row r... 1...... ā rs b r ā rs ā rs... ā a. rj is b r ā is row i... 0... a ij... b i Replace x jr by x s in B. 7. Go to step 2. ā rs... 2.4 Convergence of the Simplex Method As we have seen, the simplex method is an iterative method that generates a sequence of basic feasible solutions. But, do we have any guarantee that this process eventually terminates? The answer is yes if the linear program is nondegenerate. Theorem 2.1. The simplex method solves a nondegenerate linear program in finitely many iterations. br c s Proof. For nondegenerate linear programs, we have a strict improvement (namely of value > 0) ā rs in the objective function value at each iteration. This means that, in the sequence of bfs produced by the simplex method, each bfs can appear at most once. Therefore, for nondegenerate linear programs, the number of iterations is certainly upper bounded by the number of bfs. This latter number is finite (for example, it is upper bounded by ( n ) m ) since any bfs corresponds to m variables being basic 3. However, when the linear program is degenerate, we might have degenerate pivots which give no strict improvement in the objective function. As a result, a subsequence of bases might repeat implying the nontermination of the method. This phenomenon is called cycling. 2.4.1 An Example of Cycling The following is an example that will cycle if unfortunate choices of entering and leaving variables are made (the pivot element is within a box). 3 Not all choices of basic variables give rise to feasible solutions. ā rs LP-12

z x 1 x 2 x 3 x 4 x 5 x 6 1 4 1.92-16 -0.96 0-12.5-2 12.5 1 1 0 1 0.24-2 -0.24 1 0 z x 1 x 2 x 3 x 4 x 5 x 6 1 0.96-8 0-4 0 1-12.5-2 1 12.5 0 1 0.24-2 -0.24 1 0 z x 1 x 2 x 3 x 4 x 5 x 6 1 4 1.92-0.96-16 0 1-12.5-2 1 12.5 0 1 1 0.24-0.24-2 0 z x 1 x 2 x 3 x 4 x 5 x 6 1-4 0.96 0-8 0 12.5 1 1-2 -12.5 0 1 1 0.24-0.24-2 0 z x 1 x 2 x 3 x 4 x 5 x 6 1-16 -0.96 1.92 4 0 12.5 1 1-2 -12.5 0-2 -0.24 1 0.24 1 0 z x 1 x 2 x 3 x 4 x 5 x 6 1-8 0-4 0.96 0-12.5-2 12.5 1 1 0-2 -0.24 1 0.24 1 0 z x 1 x 2 x 3 x 4 x 5 x 6 1 4 1.92-16 -0.96 0-12.5-2 12.5 1 1 0 1 0.24-2 -0.24 1 0 2.4.2 Bland s Anticycling Rule The simplex method, as described in the previous section, is ambiguous. First, if we have several variables with a positive c s (cfr. Step 3) we have not specified which will enter the basis. Moreover, there might be several variables attaining the minimum in the minimum ratio test (Step 5). If so, we need to specify which of these variables will leave the basis. A pivoting rule consists of an entering variable rule and a leaving variable rule that unambiguously decide what will be the entering and leaving variables. The most classical entering variable rule is: LP-13

Largest coefficient entering variable rule: Select the variable x s with the largest c s > 0. In case of ties, select the one with the smallest subscript s. The corresponding leaving variable rule is: Largest coefficient leaving variable rule: Among all rows attaining the minimum in the minimum ratio test, select the one with the largest pivot ā rs. In case of ties, select the one with the smallest subscript r. The example of subsection 2.4.1 shows that the use of the largest coefficient entering and leaving variable rules does not prevent cycling. There are two rules that avoid cycling: the lexicographic rule and Bland s rule (after R. Bland who discovered it in 1976). We ll just describe the latter one, which is conceptually the simplest. Bland s anticycling pivoting rule: Among all variables x s with positive c s, select the one with the smallest subscript s. Among the eligible (according to the minimum ratio test) leaving variables x l, select the one with the smallest subscript l. Theorem 2.2. The simplex method with Bland s anticycling pivoting rule terminates after a finite number of iterations. Proof. The proof is by contradiction. If the method does not stop after a finite number of iterations then there is a cycle of tableaus that repeats. If we delete from the tableau that initiates this cycle the rows and columns not containing pivots during the cycle, the resulting tableau has a cycle with the same pivots. For this tableau, all right-hand-sides are zero throughout the cycle since all pivots are degenerate. Let t be the largest subscript of the variables remaining. Consider the tableau T 1 in the cycle with x t leaving. Let B = {x j1,...,x jm } be the corresponding basis (say j r = t), x s be the associated entering variable and, a 1 ij and c1 j the constraint and cost coefficients. On the other hand, consider the tableau T 2 with x t entering and denotes by a 2 ij and c2 j the corresponding constraint and cost coefficients. Let x be the (infeasible) solution obtained by letting the nonbasic variables in T 1 be zero except for x s = 1. Since all RHS are zero, we deduce that x ji = a is for i =1,...,m.SinceT 2 is obtained from T 1 by elementary row operations, x must have the same objective function value in T 1 and T 2. This means that m c 1 0 c 1 s = c 2 0 c 2 s + a 1 isc 2 j i. i=1 Since we have no improvement in objective function in the cycle, we have c 1 0 = c2 0.Moreover,c1 s > 0 and, by Bland s rule, c 2 s 0 since otherwise x t would not be the entering variable in T 2. Hence, m a 1 isc 2 j i < 0 i=1 implying that there exists k with a 1 ks c2 j < 0. Notice that k = r, i.e. j k <t, since the pivot element k in T 1, a 1 rs, must be positive and c 2 t > 0. However, in T 2, all cost coefficients c 2 j except c2 t are nonnegative; otherwise x j would have been selected as entering variable. Thus c 2 j < 0anda 1 k ks > 0. This is a contradiction because Bland s rule should have selected x jk rather than x t in T 1 as leaving variable. LP-14

2.5 Phase I of the Simplex Method In this section, we show how to transform a linear program into the form presented in Section 2.2. For that purpose, we show how to find a basis of the linear program which leads to a basic feasible solution. Sometimes, of course, we may inherit a bfs as part of the problem formulation. For example, we might have constraints of the form Ax b with b 0 in which case the slack variables constitute a bfs. Otherwise, we use the two-phase simplex method to be described in this section. Consider a linear program in standard form with b 0 (this latter restriction is without loss of generality since we may multiply some constraints by -1). In phase I, instead of solving Max z = c0 + c x (P ) Ax = b x 0 T we add some artificial variables {x a i : i =1,...,m} and consider the linear program: Min m w = x a i i=1 Ax + Ix a = b x 0,x a 0. This program is not in the form required by the simplex method but can easily be transformed to it. Changing the min w by max w = w and expressing the objective function in terms of the initial variables, we obtain: (Q) Max w = e T b +(e T A)x Ax + Ix a = b x 0,x a 0 where e is a vector of 1 s. We have artificially created a bfs, namely x = 0 and x a = b. Wenowuse the simplex method as described in the previous section. There are three possible outcomes. 1. w is reduced to zero and no artificial variables remain in the basis, i.e. we are left with a basis consisting only of original variables. In this case, we simply delete the columns corresponding to the artificial variables, replace the objective function by the objective function of (P )after having expressed it in terms of the nonbasic variables and use Phase II of the simplex method as described in Section 2.3. 2. w < 0 at optimality. This means that the original LP (P ) is infeasible. Indeed, if x is feasible in (P )then(x, x a = 0) is feasible in (Q) withvaluew =0. LP-15

3. w is reduced to zero but some artificial variables remain in the basis. These artificial variables must be at zero level since, for this solution, w m = i=1 xa i = 0. Suppose that the ith variable ofthe basis is artificial. We may pivot on any nonzero (not necessarily positive) element ā ij of row i corresponding to a non-artificial variable x j.sinceb i = 0, no change in the solution or in w will result. We say that we are driving the artificial variables out of the basis. By repeating this for all artificial variables in the basis, we obtain a basis consisting only of original variables. We have thus reduced this case to case 1. There is still one detail that needs consideration. We might be unsuccessful in driving one artificial variable out the basis if ā ij =0forj =1,...,n. However, this means that we have arrived at a zero row in the original matrix by performing elementary row operations, implying that the constraint is redundant. We can delete this constraint and continue in phase II with a basis of lower dimension. Example Consider the following example already expressed in tableau form. z x 1 x 2 x 3 x 4 1 20 16 12 5 0 1 0 1 2 4 0 1 2 3 2 0 1 0 2 2 We observe that we don t need to add three artificial variables since we can use x 1 as first basic variable. In phase I, we solve the linear program: w x 1 x 2 x 3 x 4 xa 1 xa 2 1 2 2 5 4 1 0 1 2 4 1 2 3 1 2 1 0 2 1 2 The objective function is to minimize x a 1 +x 2 a and, as a result, the objective function coefficients of the nonbasic variables as well as c 0 are obtained by taking the negative of the sum of all rows corresponding to artificial variables. Pivoting on ā 22, we obtain: w x 1 x 2 x 3 x 4 xa 1 xa 2 1-2 -1-2 0 1 1 2 0 4 1 2 3 1 2-2 -1-1 1 0 This tableau is optimal and, since w = 0, the original linear program is feasible. To obtain a bfs, we need to drive x a 1 out of the basis. This can be done by pivoting on say ā 34. Doing so, we get: LP-16

a x 2 w x 1 x 2 x 3 x a 4 x 1 1 0-1 -1 0 1-3 -2 2 4 1-4 -2 3 2 2 1 1-1 0 Expressing z as a function of {x 1,x 2,x 4 }, we have transformed our original LP into: z x 1 x 2 x 3 x 4 1 126-112 1-3 4 1-4 2 2 1 0 This can be solved by phase II of the simplex method. 3 Linear Programming in Matrix Form In this chapter, we show that the entries of the current tableau are uniquely determined by the collection of decision variables that form the basis and we give matrix expressions for these entries. Consider a feasible linear program in standard form: Max z = c T x Ax = b x 0, where A has full row rank. Consider now any intermediate tableau of phase II of the simplex method and let B denote the corresponding collection of basic variables. If D (resp. d) isanm n matrix (resp. an n-vector), let D B (resp. d B ) denote the restriction of D (resp. d) tothecolumns (resp. rows) corresponding to B. We define analogously D N and d N for the collection N of nonbasic variables. For example, Ax = b can be rewritten as A B x B + A N x N = b. After possible regrouping of the basic variables, the current tableau looks as follows: x B x NT z 0 c N c 0 Ā B = I Ā N b. Since the current tableau has been obtained from the original tableau by a sequence of elementary row operations, we conclude that there exists an invertible matrix P (see Section 2.1) such that: PA B = A B = I PA N = A N and Pb = b. LP-17

This implies that P = A 1 B and therefore: ĀN = A 1 B A N and b = A 1 B b. Moreover, since the objective functions of the original and current tableaus are equivalent (i.e. c T T T T T B x B + c N x N = c 0 + c B x B + c N x N = c 0 + c N x N )andx B = b A N x N,wederivethat: and This can also be written as: c TN = c T N c T BA N = c T N c T BA 1 B A N c 0 = c T Bb = c T BA 1 B b. c T = c T c T BA B1 A. As we ll see in the next chapter, it is convenient to define an m-vector y by y T = c T B A B1. In summary, the current tableau can be expressed in terms of the original data as: x B x N z 0 c T N y T A N y T b I A 1 B A N A 1 B b. The simplex method could be described using this matrix form. For example, this optimality criterion becomes c T N y T AN 0 or, equivalently, c T y T A 0, i.e. A T y c where y T = c T B A 1 B. 4 Duality Duality is the most important and useful structural property of linear programs. illustrating the notion on an example. Consider the linear program: We start by Max z =5x 1 +4x 2 x 1 4 (1) x 1 +2x 2 10 (2) 3x 1 +2x 2 16 (3) x 1,x 2 0. We shall refer to this linear program as the primal. By exhibiting any feasible esolution, say x 1 =4 and x 2 = 2, one derives a lower bound (since we are maximizing) on the optimum value z of the linear program; in this case, we have z 28. How could we derive upper bounds on z? Multiplying inequality (3) by 2, we derive that 6x 1 +4x 2 32 for any feasible (x 1,x 2 ). Since x 1 0, this in turn implies that z =5x 1 +4x 2 6x 1 +4x 2 32 for any feasible solution and, thus, z 32. One can even combine several inequalities to get upper bounds. Adding up all three inequalities, we get 5x 1 +4x 2 30, implying that z 30. In general, one would multiply inequality (1) LP-18

by some nonnegative scalar y 1, inequality (2) by some nonnegative y 2 and inequality (3) by some nonnegative y 3, and add them together, deriving that (y 1 + y 2 +3y 3 )x 1 +(2y 2 +2y 3 )x 2 4y 1 +10y 2 +16y 3. To derive an upper bound on z, one would then impose that the coefficients of the x i s in this implied inequality dominate the corresponding cost coefficients: y 1 +y 2 +3y 3 5and2y 2 +2y 3 4. To derive the best upper bound (i.e. smallest) this way, one is thus led to solve the following so-called dual linear program: Min w =4y 1 +10y 2 +16y 3 y 1 + y 2 +3y 3 5 2y 2 +2y 3 4 y 1 0,y 2 0,y 3 0. Observe how the dual linear program is constructed from the primal: one is a maximization problem, the other a minimization; the cost coefficients of one are the RHS of the other and vice versa; the constraint matrix is just transposed (see below for more precise and formal rules). The optimum solution to this linear program is y 1 =0,y 2 =0.5 andy 3 =1.5, giving an upper bound of 29 on z. What we shall show in this chapter is that this upper bound is in fact equal to the optimum value of the primal. Here, x 1 = 3 and x 2 =3.5 is a feasible solution to the primal of value 29 as well. Because of our upper bound of 29, this solution must be optimal, and thus duality is a way to prove optimality. 4.1 Duality for Linear Programs in canonical form Given a linear program (P ) in canonical form Max z = c T x (P ) Ax b x 0 we define its dual linear program (D) as (D) Min w = b T y A T y c y 0. (P ) is called the primal linear program. Notice there is a dual variable associated with each primal constraint, and a dual constraint associated with each primal variable. In fact, the primal and dual are indistinguishable in the following sense: Proposition 4.1. The dual of the dual is the primal. LP-19

Proof. To construct the dual of the dual, we first need to put (D) in canonical form: Max w = w = b T y (D ) A T y c y 0. Therefore the dual (DD )ofd is: (DD ) Min z = c T x Ax b x 0. Transforming this linear program into canonical form, we obtain (P ). Theorem 4.2 (Weak Duality). If x is feasible in (P )withvaluez and y is feasible in (D) with value w then z w. Proof. x z = c T 0 y 0 x (A T y) T x = y T Ax y T b = b T y = w. Any dual feasible solution (i.e. feasible in (D)) gives an upper bound on the optimal value z of the primal (P ) and vice versa (i.e. any primal feasible solution gives a lower bound on the optimal value w of the dual (D)). In order to take care of infeasible linear programs, we adopt the convention that the maximum value of any function over an empty set is defined to be while the minimum value of any function over an empty set is +. Therefore, we have the following corollary: Corollary 4.3 (Weak Duality). z w. What is more surprising is the fact that this inequality is in most cases an equality. Theorem 4.4 (Strong Duality). If z is finite then so is w and z = w. Proof. The proof uses the simplex method. In order to solve (P ) with the simplex method, we reformulate it in standard form: Max z = c T x (P ) Ax + Is = b x 0,s 0. ( ) ( ) Let A x c =(AI), x = and c =.LetBbethe optimal basis obtained by the simplex s 0 method. The optimality conditions imply that à T y c LP-20

where Replacing A by (A I)andc by and y T =(c B) T Ã 1 B. ( c ), we obtain: 0 A T y c y 0. This implies that y is a dual feasible solution. Moreover, the value of y is precisely w = y T b = ( c B) T Ã 1 B b =(c B) T x B = z. Therefore, by weak duality, we have z = w. Since the dual of the dual is the primal, we have that if either the primal or the dual is feasible and bounded then so are both of them and their values are equal. From weak duality, we know that if (P ) is unbounded (i.e. z =+ ) then(d) is infeasible (w =+ ). Similarly, if (D) is unbounded (i.e. w = ) then(p ) is infeasible (z = ). However, the converse to these statements are not true: There exist dual pairs of linear programs for which both the primal and the dual are infeasible. Here is a summary of the possible alternatives: Primal Dual z finite unbounded (z = ) infeasible (z = ) w finite z = w impossible impossible unbounded (w = ) impossible impossible possible infeasible (w =+ ) impossible possible possible 4.2 The dual of a linear program in general form In order to find the dual of any linear program (P ), we can first transform it into a linear program in canonical form (see Section 1.2), then write its dual and possibly simplify it by transforming it into some equivalent form. For example, considering the linear program Max z = c T x aijx j (P ) j b i i I 1 aij x j b i i I j aij x j = b i j x j 0 2 i I 3 j =1,...,n, LP-21

we can first transform it into Max z = c T x aijx j b i i I 1 j (P ) a ij x j b i i I 2 j aij x j b i j i I 3 a ij x j b i i I 3 j x j 0 j =1,...,n. Assigning the vectors y 1,y 2,y 3 and y 4 of dual variables to the first, second, third and fourth set of constraints respectively, we obtain the dual: Min w = b i yi 1 2 3 4 bi y i + b i y i b i y i (D ) i I 1 i I 2 i I 3 i I 3 a 3 ijyi 1 a 2 4 ij y i + a ij y i a ij y i c j i I 1 i I 2 i I 3 i I 3 y 1,y 2,y 3,y 4 0. This dual can be written in a simplified form by letting y i = yi 1 i I1 y i = yi 2 i I 2 yi = yi 3 y4 i i I 3. In terms of y i, we obtain (verify it!) the following equivalent dual linear program j =1,...,n (D) Min w = b i y i i I aij y i c j j =1,...,n i I y i 0 i I 1 y i 0 i I 2 y i 0 i I 3, where I = I 1 I 2 I 3. We could have avoided all these steps by just noticing that, if the primal program is a maximization program, then inequalities with a sign in the primal correspond to nonnegative dual LP-22

variables, inequalities with a sign correspond to nonpositive dual variables, and equalities correspond to unrestricted in sign dual variables. By performing similar transformations for the restrictions on the primal variables, we obtain the following set of rules for constructing the dual linear program of any linear program: Primal Dual Max Min j a ijx j b i y i 0 j a ijx j b i y i 0 j a ijx j = b i y i 0 x j 0 i a ijy i c j x j 0 i a ijy i c j x j 0 i a ijy i = c j. If the primal linear program is in fact a minimization program then we simply use the above rules from right to left. This follows from the fact that the dual of the dual is the primal. 4.3 Complementary slackness Consider a pair of dual linear programs Max z = c T x (P ) Ax b and x 0 (D) Min w = b T y A T y c y 0. Strong duality allows to give a simple test for optimality. Theorem 4.5 (Complementary Slackness). If x is feasible in (P )andy is feasible in (D) thenx is optimal in (P ) and y is optimal in (D) iff y T (b Ax) =0and x T (A T y c). The latter statement can also be written as either y i = 0 or (Ax) i = b i (or both) and either x T j = 0 or (A y) j = c j (or both). Proof. By strong duality we know that x is optimal in (P )andy is optimal in (D) iffc T x = b T y. Moreover, (cfr. Theorem 4.2) we always have that: c T x y T Ax y T b = b T y. Therefore, c T x = b T y is equivalent to c T x = y T Ax and y T Ax = y T b. Rearranging these expressions, we obtain x T (A T y c) =0andy T (b Ax) =0. LP-23

Corollary 4.6. Let x be feasible in (P ). Then x is optimal iff there exists y such that { { A T xj =0 y c j if { = { x j > 0 (Ax)i = b y i 0 if i = (Ax) i <b i. As a result, the optimality of a given primal feasible solution can be tested by checking the feasibility of a system of linear inequalities and equalities. As should be by now familiar, we can write similar conditions for linear programs in other forms. For example, Theorem 4.7. Let x be feasible in Max z = c T x (P ) Ax = b x 0 and y feasible in Min w = b T y (D) A T y c. Then x is optimal in (P )andy is optimal in (D) iffx T (A T y c) =0. 4.4 The separating hyperplane theorem In this section, we use duality to obtain a necessary and sufficient condition for feasibility of a system of linear inequalities and equalities. Theorem 4.8 (The Separating Hyperplane Theorem). Ax = b, x 0 has no solution iff y R m : A T y 0andb T y<0. The geometric interpretation behind the separating hyperplane theorem is as follows: Let a 1,...,a n R m n be the columns of A. Thenb does not belong to the cone K = { i=1 a ix i : x i 0 for i =1,...,n} generated by the a i s iff there exists an hyperplane {x : x T y =0} (defined by its normal y) such that K is entirely on one side of the hyperplane (i.e. a T i y 0fori =1,...,n) while b is on the other side (b T y<0). Proof. Consider the pair of dual linear programs Max z =0 T x (P ) Ax = b x 0 LP-24

and Min w = b T y (D) A T y 0. Notice that (D) is certainly feasible since y = 0 is a feasible solution. As a result, duality implies that (P ) is infeasible iff (D) is unbounded. However, since λy is dual feasible for any λ 0and any dual feasible solution y, the unboundedness of (D) is equivalent to the existence of y such that A T y 0,y 0andb T y<0. Other forms of the separating hyperplane theorem include: Theorem 4.9. Ax b has no solution iff y 0:A T y = 0 and b T y<0. 5 Zero-Sum Matrix Games In a matrix game, there are two players, say player I and player II. Player I has m different pure strategies to choose from while player II has n different pure strategies. If player I selects strategy i and player II selects strategy j then this results in player I gaining a ij units and player II losing a ij units. So, if a ij is positive, player II pays a ij units to player I while if a ij is negative then player Ipays a ij units to player II. Since the amounts gained by one player equal the amounts paid by theother,thisgameiscalledazero-sum game. The matrix A =[a ij ] is known to both players andiscalledthepayoff matrix. In a sequence of games, player I (resp. player II) may decide to randomize his choice of pure strategies by selecting strategy i (resp. j) with some probability y i (resp. x j ). The vector y (resp. x) satisfies m n yi =1 (resp. x j =1), i=1 j=1 y i 0 (resp. x j 0) and defines a mixed strategy. If player I adopts the mixed strategy y then his expected gain g j if player II selects strategy j is given by: g j = a ij y i =(y T A) j = y T Ae j. By using y, player I assures himself a guaranteed gain of i g =ming j =min(y T A) j. j j Similarly, if player II adopts the mixed strategy x then his expected loss l i if player I selects strategy i is given by: l i = a ij x j =(Ax) i = e T i Ax j LP-25

and his guaranteed loss 4 is l =maxl i =max(ax) i. i i If player I uses the mixed strategy y and player II uses the mixed strategy x then the expected gain of player I is h = i,j y ia ij x j = y T Ax. Theorem 5.1. If y and x are mixed strategies respectively for players I and II then g l. Proof. We have that and proving the result. h = y T Ax = y i (Ax) i l y i = l i h = y T Ax = (y T A) j x j g xj = g j Player I will try to select y so as to maximize his guaranteed gain g while player II will select x so as to minimize l. From the above result, we know that the optimal guaranteed gain g of player Iisatmosttheoptimalguaranteedlossl of player II. The main result in zero-sum matrix games is the following result obtained by Von Neumann and called the minimax theorem. Theorem 5.2 (The Minimax Theorem). There exist mixed strategies x and y such that g = l. Proof. In order to prove this result, we formulate the objectives of both players as linear programs. Player II s objective is to minimize l. This can be expressed by: Min l (P ) Ax le e T x =1 x 0,l 0 where e is a vector of all 1 s. Indeed, for any optimal solution x,l to (P ), we know that l = max i (Ax ) i since otherwise l could be decreased without violating feasibility. Similarly, player I s objective can be expressed by: i j (D) Max g A T y ge e T y =1 y 0,g 0 Again, any optimal solution to the above program will satisfy g =min j (A T y ) j. The result follows by noticing that (P )and(d) constitute a pair of dual linear programs (verify it!) and, therefore, by strong duality we know that g = l. 4 Here guaranteed means that he ll loose at most l. LP-26

The above Theorem can be rewritten as follows (This explains why it is called the minimax theorem): Corollary 5.3. and Indeed max min y T Ax = min max y T Ax. e T y=1,y 0 e T x=1,x 0 e T x=1,x 0 e T y=1,y 0 min e T x=1,x 0 y T Ax =min(y T A) j = g max y T Ax =max(ax) i = l. e T y=1,y 0 i j Example Consider the game with payoff matrix A = ( 1 3 2 4 ). Solving the linear program (P ), we obtain the following optimal mixed strategies for both players (do it by yourself!): ( ) ( ) x 7/10 6/10 = and y =, 3/10 4/10 for which g = l = 2/10. A matrix game is said to be symmetric if A = A T. Any symmetric game is fair, i.e. g = l =0. LP-27

MIT OpenCourseWare http://ocw.mit.edu 18.310 Principles of Discrete Applied Mathematics Fall 2013 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.