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

Similar documents
1 Review Session. 1.1 Lecture 2

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

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

Review Solutions, Exam 2, Operations Research

Lecture: Algorithms for LP, SOCP and SDP

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

OPERATIONS RESEARCH. Linear Programming Problem

Lecture 2: The Simplex method

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

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

min 4x 1 5x 2 + 3x 3 s.t. x 1 + 2x 2 + x 3 = 10 x 1 x 2 6 x 1 + 3x 2 + x 3 14

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

Theory and Internet Protocols

1 Overview. 2 Extreme Points. AM 221: Advanced Optimization Spring 2016

Lecture slides by Kevin Wayne

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

Lecture 6 Simplex method for linear programming

Summary of the simplex method

A Review of Linear Programming

1. Consider the following polyhedron of an LP problem: 2x 1 x 2 + 5x 3 = 1 (1) 3x 2 + x 4 5 (2) 7x 1 4x 3 + x 4 4 (3) x 1, x 2, x 4 0

TIM 206 Lecture 3: The Simplex Method

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

CS711008Z Algorithm Design and Analysis

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

Optimization WS 13/14:, by Y. Goldstein/K. Reinert, 9. Dezember 2013, 16: Linear programming. Optimization Problems

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

A Strongly Polynomial Simplex Method for Totally Unimodular LP

MATH2070 Optimisation

CSC373: Algorithm Design, Analysis and Complexity Fall 2017 DENIS PANKRATOV NOVEMBER 1, 2017

OPTIMISATION 3: NOTES ON THE SIMPLEX ALGORITHM

3 The Simplex Method. 3.1 Basic Solutions

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

"SYMMETRIC" PRIMAL-DUAL PAIR

Linear and Combinatorial Optimization

Spring 2017 CO 250 Course Notes TABLE OF CONTENTS. richardwu.ca. CO 250 Course Notes. Introduction to Optimization

Operations Research Lecture 2: Linear Programming Simplex Method

Linear programs, convex polyhedra, extreme points

Linear Programming. 1 An Introduction to Linear Programming

Notes taken by Graham Taylor. January 22, 2005

Part 1. The Review of Linear Programming

3. THE SIMPLEX ALGORITHM

Linear Programming. Operations Research. Anthony Papavasiliou 1 / 21

Algorithms and Theory of Computation. Lecture 13: Linear Programming (2)

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

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

Farkas Lemma, Dual Simplex and Sensitivity Analysis

Linear Programming Inverse Projection Theory Chapter 3

Input: System of inequalities or equalities over the reals R. Output: Value for variables that minimizes cost function

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

3. Linear Programming and Polyhedral Combinatorics

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

Optimization (168) Lecture 7-8-9

Chap6 Duality Theory and Sensitivity Analysis

MATH 4211/6211 Optimization Linear Programming

Chapter 3, Operations Research (OR)

A Bound for the Number of Different Basic Solutions Generated by the Simplex Method

IE 5531: Engineering Optimization I

4. Duality and Sensitivity

Linear Programming and the Simplex method

IE 5531: Engineering Optimization I

Lecture 10: Linear programming duality and sensitivity 0-0

Lecture 5. Theorems of Alternatives and Self-Dual Embedding

MATH 445/545 Homework 2: Due March 3rd, 2016

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

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

Linear programming. Saad Mneimneh. maximize x 1 + x 2 subject to 4x 1 x 2 8 2x 1 + x x 1 2x 2 2

Linear Programming. Chapter Introduction

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

Introduction to Mathematical Programming

Math 273a: Optimization The Simplex method

Introduction to optimization

MAT016: Optimization

Discrete Optimization

AM 121: Intro to Optimization Models and Methods

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

4.6 Linear Programming duality

MVE165/MMG631 Linear and integer optimization with applications Lecture 5 Linear programming duality and sensitivity analysis

Simplex Algorithm Using Canonical Tableaus

21. Solve the LP given in Exercise 19 using the big-m method discussed in Exercise 20.

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

Lecture 9 Tuesday, 4/20/10. Linear Programming

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

The Strong Duality Theorem 1

CO 250 Final Exam Guide

CSCI : Optimization and Control of Networks. Review on Convex Optimization

The Simplex Method for Solving a Linear Program Prof. Stephen Graves

3. Linear Programming and Polyhedral Combinatorics

Simplex Method for LP (II)

LP Duality: outline. Duality theory for Linear Programming. alternatives. optimization I Idea: polyhedra

The Simplex Method. Lecture 5 Standard and Canonical Forms and Setting up the Tableau. Lecture 5 Slide 1. FOMGT 353 Introduction to Management Science

Week 3 Linear programming duality

Contents. 4.5 The(Primal)SimplexMethod NumericalExamplesoftheSimplexMethod

Chapter 1 Linear Programming. Paragraph 5 Duality

LOWER BOUNDS FOR THE MAXIMUM NUMBER OF SOLUTIONS GENERATED BY THE SIMPLEX METHOD

Lecture Note 18: Duality

2.098/6.255/ Optimization Methods Practice True/False Questions

Properties of a Simple Variant of Klee-Minty s LP and Their Proof

Linear Programming: Simplex

F 1 F 2 Daily Requirement Cost N N N

Summary of the simplex method

Transcription:

CSCI 1951-G Optimization Methods in Finance Part 01: Linear Programming January 26, 2018 1 / 38

Liability/asset cash-flow matching problem Recall the formulation of the problem: max w c 1 + p 1 e 1 = 150 c 2 + p 2 + 1.003e 1 1.01c 1 e 2 = 100 c 3 + p 3 + 1.003e 2 1.01c 2 e 3 = 200 c 4 1.02p 1 1.01c 3 + 1.003e 3 e 4 = 200 c 5 1.02p 2 1.01c 4 + 1.003e 4 e 5 = 50 1.02p 3 1.01c 5 + 1.003e 5 w = 300 0 c i 100, i i 5 p i > 0, 1 i 3 e i 0, 1 i 5 This is a Linear Programming (LP) problem: the variables are continuous; the constraints are linear functions of the variables; the objective function is linear in the variable. 2 / 38

Linear Programming Linear Programming is arguably the best known and most frequently solved class of optimization problems. Definition (Linear Program) A generic LP problem has the following form: min c T x a T x = b for (a, b) E a T x b for (a, b) I where x R n is the vector of decision variables; c R n, the costs vector, defines the objective function; E and I are sets of pairs (a, b) where a R n, and b R. Any assignment of values to x is called a solution. A feasible solution satisfies the constraints. The optimal solution is feasible and minimize the objective function. 3 / 38

Graphical solution to a linear optimization problem Let s solve: max 500x 1 + 450x 2 x 1 + 5 6 x 2 10 x 1 + 2x 2 15 x 1 8 x 1, x 2 0 4 / 38

Standard form and slack variables More often, we will express LP in the standard form Standard Form min c T x Ax = b x 0 where A is a n n matrix, and b R n. The standard form is not restrictive: we can rewrite inequality constraints as equalities by introducing slack variables; maximization problems can be written as minimization problems by multiplying the objective function by 1. variables that are unrestricted in sign can be expressed as the difference of two new non-negative variables. 5 / 38

Standard form and slack variables (cont.) How do we express the following problem in standard form? Non-standard form Standard form max x 1 + x 2 2x 1 + x 2 12 x 1 + 2x 2 9 x 1 0, x 2 0 min x 1 x 2 2x 1 + x 2 + z 1 = 12 x 1 + 2x 2 + z 2 = 9 x 1 0, x 2 0, z 1 0, z 2 0 The z i are slack variables: they appear in the constraints, but not in the objective function. 6 / 38

Lower bounds to the optimal objective value We would like to compute an optimal solution to a LP... But let s start with an easier question: Question How can we find a lower bound to the objective function value for a feasible solution? Intuition for the answer The constraints provide some bounds on the value of the objective function. 7 / 38

Consider Question Lower bounds (cont.) min x 1 x 2 2x 1 + x 2 12 x 1 + 2x 2 9 x 1 0, x 2 0 Can we use the first constraint to give a lower bound to x 1 x 2 for any feasible solution? Answer (Yes!) Any feasible solution must be such that x 1 x 2 2x 1 x 2 12. We leverage the fact that the coefficients in the constraint (multiplied by -1) are lower bounds to the coefficients in the objective function. 8 / 38

Lower bounds (cont.) The second constraint gives us a better bound: x 1 x 2 x 1 2x 2 9 Question Can we do even better? Yes, with a linear combination of the constraints: x 1 x 2 1 3 (2x 1 + x 2 ) 1 3 (x 1 + 2x 2 ) 1 (12 + 9) 7 3 No feasible solution can have an objective value smaller than -7. 9 / 38

Lower bounds (cont.) General strategy Find a linear combination of the constraints such that the resulting coefficient for each variable is no larger than the corresponding coefficient in the objective function; and the resulting lower bound to the optimal objective value is maximized. In other words, we want to find the coefficients of the linear combinations of constraints that satisfy the new constraints on the coefficients of the variables, and maximize the lower bound. This is a new optimization problem: the dual problem. The original problem is known as the primal problem. 10 / 38

Dual problem Question What is the dual problem in our example? Answer In general: Primal problem min c T x Ax b x 0 max 12y 1 + 9y 2 2y 1 + y 2 1 y 1 + 2y 2 1 y 1, y 2 0 Dual problem max b T y A T y c y 0 Dual problem (min. form) min b T y A T y c y 0 11 / 38

Weak duality Theorem (Weak duality) Let x be any feasible solution to the primal LP and y be any feasible solution to the dual LP. Then c T x b T y. Proof. We have c T x b T y = c T x y T b = c T x y T Ax = (c A T y) T x > 0 where the last step follows from x 0 and (c A T y) 0 (why?). Definition (Duality gap) The quantity c T x b T y is known as the duality gap. 12 / 38

Strong duality Corollary If: x is feasible for the primal LP ; y is feasible for the dual LP; and c T x = b T y; then x must be optimal for the primal LP and y must be optimal for the dual LP. The above gives a sufficient condition for optimality of a primal-dual pair of feasible solutions. This condition is also necessary. Theorem (Strong duality) If the primal (resp. dual) problem has an optimal solution x (resp. y), then the dual (resp. primal) has an optimal solution y (resp. x) such that c T x = b T y. 13 / 38

Complementary slackness How can we obtain an optimal solution to the dual problem from an optimal solution to the primal (and viceversa)? Theorem (Complementary slackness) Let x be an optimal solution for the primal LP and y be an optimal solution to the dual LP. Then y T (Ax b) = 0 and Proof. Exercise. (c T y T A)x = 0 14 / 38

Algorithms for solving LP Due to the great relevance of LP in many fields, a number of algorithms have been developed to solve LP problems. Simplex Algorithm: Due to G. Dantzig in 1947, it was a breakthrough and it is considered one of the top 10 algorithms of the twentieth century. It is an exponential time algorithm, but extremely efficient in practice also for large problems. Ellipsoid Method: by Yudin and Nemirovski in 1976, it was the first polynomial time algorithm for LP. In practice, the performance is so bad that the algorithm is only of theoretical interest, and even so, only for historical purposes. Interior-Point Method: by Karmarkar in 1984, it is the first polynomial time algorithm for LP that can solve some real-world LPs faster than the simplex. We now present and analyze the Simplex Algorithm, and will discuss the Interior-Point Method later, in the context of Quadratic Programming. 15 / 38

Roadmap 1 Look at the geometry of the LP feasible region 2 Prove the existence of an optimal solution that satisfy a specific geometrical condition 3 Study what solutions that satisfy the condition look like 4 Discuss how to move between solutions that satisfy the condition 5 Use these ingredients to develop an algorithm 6 Analyze correctness and running time complexity 16 / 38

Convex polyhedra Definition (Convex polyhedron) A convex polyhedron P is the solution set of a system of m linear inequalities: P = {x R n : Ax b} A is m n, b is m 1. Fact The feasible region of an LP is a convex polyhedron. Definition (Polyhedron in standard form) A is m n, b is m 1. P = {x R n : Ax = b, x 0} 17 / 38

Extreme points and their optimality Definition (Extreme point) x P is an extreme point of P iff there exist no distinct y, z P, λ (0, 1) s.t. x = λy + (1 λ)z. Theorem (Optimality of extreme points) Let P R n be a polyhedron and consider the problem min x P c T x for a given c R n. If P has at least one extreme point and there exists an optimal solution, then there exists an optimal solution that is an extreme point. Proof. Coming up. 18 / 38

Proof of optimality of extreme points v: optimal objective value Q: set of optimal solutions, Q = {x R n : Ax = b, x 0, c T x = v} P Fact Q is a convex polyhedron. Fact Since Q P and P has an extreme point, Q must have an extreme point. Let x be an extreme point of Q. We now show that x is an extreme point in P. 19 / 38

Proof of optimality of extreme points (cont.) Let s show that x (extreme point of Q) is an extreme point of P. Assume x is not an extreme point of P, i.e., y, z P, y x, z x, λ (0, 1) s.t. λy + (1 λ)z = x. How can we write c T x? c T x = λc T y + (1 λ)c T z. Let s compare c T x and c T y and c T x and c T z. It must be c T y c T x or c T z c T x. Suppose c T y c T x. It must also be c T y = c T x. Why? Because x is an optimal solution: c T y = c T x = v. But then what about c T z? c T z = v. What does c T y = c T z = v imply? They must belong to Q. Does this contradict the hypothesis? We found y and z in Q s.t. x = λy + (1 λ)z, so x is not an extreme point of Q. We reach a contradiction, thus x is an extreme point in P. QED 20 / 38

Extreme points and consequences Theorem Every convex polyhedron in standard form has an extreme point. Corollary Every LP with a non-empty feasible region P either has optimal value ; or there exists an optimal solution at one of the extreme points of P. 21 / 38

Algorithmic idea and questions Algorithmic idea Find an initial extreme point x. While x is not optimal: x a different extreme point. Output x There may be many extreme points, so not the best algorithm? We must answer the following questions: What is the algebraic form of extreme points? How do we move among extreme points? How do we avoid revisiting the same extreme point / ensure that we find all of them if necessary? How do we know that an extreme point is optimal? How do we find the first extreme point? 22 / 38

Basic solutions Assume from now on that the m rows of A are linearly independent. Consider a set of m columns of A = [a 1 a n ] that are linearly independent. Let r 1,..., r m be their indices. Let B = [a r1 a rm ]. Dimensions of B are m m. Permute the columns of A to obtain [B N]. Consider the same permutation for the rows of x to obtain [x T B xt N ]T. [ xb Ax = b [B N] x N Bx B + Nx N = b ] = b x B = B 1 b B 1 Nx N Why is B invertible? It s a square matrix with full rank. What s an easy solution to the last equation? x N = 0 and x B = B 1 b. A solution obtained this way is known as a basic solution. 23 / 38

Basic solutions To obtain a basic solution: 1 Choose m linearly independent columns of A to obtain B. The columns in B are known as the basic columns. 2 Split the variables x into basic variables x B and non-basic variables x N. 3 Set the non-basic variables x N to zero. 4 Set x B = B 1 b. Is a basic solution x always feasible? No. It must also be x 0! (i.e., x B 0). If x is basic and feasible, is a Basic Feasible Solution (BFS). 24 / 38

Basic feasible solutions and extreme points Theorem Each BFS corresponds to one and only one extreme point of P. Proof: (only that a BFS x must be an extreme point of P). Assume that x is not an extreme point of P. What does it mean? distinct y, z P and λ (0, 1) s.t. x = λy + (1 λ)z. What about x B and y B, z B, and x N and y N, z N? 0 = x N = λy N + (1 λ)z N It must be...y N = z N = 0, because y, z P, so y, z 0. What about x B and y B and z B? x B = B 1 b but also must be By B = b and Bz B = bi so it must be x B = y B = z B. What s the contradiction? We did not find distinct y and z to express x. 25 / 38

Corollary If P is not empty, either the optimal value is or there is a BFS...that is optimal. BFSs are algebraic representations of the geometric extreme points. Algorithmic idea Find an initial BFS x. While x is not optimal: x a different BFS. Output x 26 / 38

Adjacent BFS and directions Definition (Adjacent BFSs) Two BFSs are adjacent iff their basic matrices differ in only one basic column. We want to move between adjacent BFSs because they look similar. How do we move among adjacent bfs? Definition (Feasible direction) Let x P. A vector d R n is a feasible direction at x if there exists θ > 0 such that x + θd P. Definition (Improving direction) Consider the LP min x P c T x. A vector d R n is a improving direction if c T d < 0. Starting from a BFS, we want to find a feasible improving direction towards an adjacent BFS. 27 / 38

Basic (feasible) directions Fact Any direction that is feasible at a BFS x must have a stricly positive value in at least one of the components corresponding to non-basic variables of x (why?). We move in a basic direction d = [d B d N ] that has a strictly positive value in exactly one of the components corresponding to non-basic variables, e.g., x j. We fix d N so that d j = 1 d i = 0 for every non-basic index i j And d B = B 1 a j. The choice for d B comes from the requirement Ad = 0 for any feasible direction d (why?). 28 / 38

Reduced costs How do we know if the chosen basic feasible direction is improving? Definition (Reduced cost) Let x be a basic solution with basis matrix B, and let c B be the vector of the costs of the basic variables. For each 1 i n, the reduced cost ĉ i of variable x i is ĉ i = c i c T BB 1 a i. Fact The basic direction associated with x j is improving iff ĉ j < 0. Why? (Hint: ĉ B = 0 (why?)) 29 / 38

Optimality condition Definition (Degenerate bfs) Let x be a bfs. x is said to be degenerate iff {j : x j > 0} < m. Theorem Let x be a BFS and let ĉ be the corresponding vector of reduced costs. if ĉ 0, then x is optimal. if x is optimal and nondegenerate, then ĉ 0. 30 / 38

Step size Let d be a basic, feasible, improving direction from the current BFS x, and let B be the basis matrix for x. We want to find move along d to find a BFS x adjacent to x that can be expressed as x = x + θd for some value θ R. How to compute the step size θ? We know that at x, one of the basic variables in x will be 0. We want to find the maximum θ such that x B + θd B 0. Let u = d B = B 1 a j. The value of a basic variable x ri changes, along d, at a rate of x ri /u ri. Hence we want θ = x ri min. r i : u ri >0 u i The basic variable x ri that attains the minimum is the one that leaves the BFS (it is a non-basic variable at x ). 31 / 38

Bland s rule What non-basic variable should enter the BFS? If more than one basic variable could leave (i.e., more than one basic variable attains the minimum that gives θ), which one should leave? Why does all this matter? Without an accurate choice of the entering/exiting variables, the algorithm may cycle forever at the same degenerate BFS. Bland s anticycling rule (eliminates the risk of cycling) Among all non-basic variables that can enter the basis, choose the one with the minimum index. Among all basic variables that can exit the basis, choose the one with the minimum index. 32 / 38

The Simplex algorithm 1 Start from a bfs x, with basic variables x r1,..., x rm and basis matrix B. 2 Compute the reduced costs ĉ j = c j c T B B 1 a j for 1 j n. If ĉ 0, then x is optimal. 3 Use Bland s rule to select the entering variable x j and obtain u = d B = B 1 a j by solving the system Bu = a j. If u 0, then the LP is unbounded. 4 Compute the step size θ = min ri : u ri >0 xr i u ri. 5 Determine the new solution and the leaving variable x ri, using Bland s rule. 6 Replace x ri with x j in the list of basic variables. 7 Go to step 1. 33 / 38

Runtime Fact There are at most ( n m) basic (feasible) solutions. Why? There are artifical LPs where the simplex visits all BFS Runtime is not polynomial. With distribution assumptions on the input, the simplex performs O(n 4 ) iterations, each taking time O(nm). For real-world instances, the average is 3(n m) steps. 34 / 38

Finding the first BFS The simplex algorithm needs a BFS to start. How do we find it? How to find a feasible solution s.t. x i = 0? Set the objective function to be just x i, and find the optimal solution to this problem. If the optimal value is 0 then we found a feasible solution with x i = 0, otherwise there is no such feasible solution. If we want multiple variables set to 0, set the objective function to be to the sum of the variables that should be 0. 35 / 38

Two-phases simplex algorithm Two-phases simplex algorithm 1 introduce artificial variables (not the same as slack variables); 2 easily find initial BFS involving the artificial variables; 3 Set objective function to be the sum of the artificial variables; 4 Run the simplex algorithm on the modified LP; 5 If the optimal value is 0, we obtain a BFS for the original LP. Otherwise, the original LP has no feasible solution; 6 If we found an inital BFS for the original problem, run the simplex algorithm on it. This procedure is known as the Two-phases simplex algorithm, with steps 1-5 being Phase 1 and step 6 being Phase 2. 36 / 38

Artificial variables and initial BFS Introducing the aritificial variables Start with a LP in standard form. Add to the LHS of each constraint an artificial variable with sign equal to the sign of the RHS. Initial BFS (for the artificial LP) A BFS with the artificial variables being the basic variables, with values equal to the RHS of their constraints (non-artificial variables are (non-basic) and set to 0). We can now solve the artificial LP and find a BFS for the original LP, if it exists. 37 / 38

Dual Simplex Through strong duality, we can compute the dual optimal solution dual optimal solution after having solved the primal optimal solution with the simplex algorithm. Observation Solve the primal by solving the dual with the simplex, and then obtain a primal optimal solution from the dual optimal solution. The advantage is that if c 0, then y = 0 is dual feasible, so we can avoid Phase 1, and go directly to finding the optimal solution. 38 / 38