Linear Programming. Widget Factory Example. Linear Programming: Standard Form. Widget Factory Example: Continued.



Similar documents
Can linear programs solve NP-hard problems?

Linear Programming I

5.1 Bipartite Matching

Lecture 3. Linear Programming. 3B1B Optimization Michaelmas 2015 A. Zisserman. Extreme solutions. Simplex method. Interior point method

1 Introduction. Linear Programming. Questions. A general optimization problem is of the form: choose x to. max f(x) subject to x S. where.

LECTURE 5: DUALITY AND SENSITIVITY ANALYSIS. 1. Dual linear program 2. Duality theory 3. Sensitivity analysis 4. Dual simplex method

Lecture 2: August 29. Linear Programming (part I)

Linear Programming Notes V Problem Transformations

Linear Programming. March 14, 2014

4.6 Linear Programming duality

What is Linear Programming?

Applied Algorithm Design Lecture 5

3. Evaluate the objective function at each vertex. Put the vertices into a table: Vertex P=3x+2y (0, 0) 0 min (0, 5) 10 (15, 0) 45 (12, 2) 40 Max

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. !-approximation algorithm.

Chapter Load Balancing. Approximation Algorithms. Load Balancing. Load Balancing on 2 Machines. Load Balancing: Greedy Scheduling

4.1 Learning algorithms for neural networks

3. Linear Programming and Polyhedral Combinatorics

1 Solving LPs: The Simplex Algorithm of George Dantzig

. P. 4.3 Basic feasible solutions and vertices of polyhedra. x 1. x 2

Linear Programming Problems

Transportation Polytopes: a Twenty year Update

Study Guide 2 Solutions MATH 111

Practical Guide to the Simplex Method of Linear Programming

1 Linear Programming. 1.1 Introduction. Problem description: motivate by min-cost flow. bit of history. everything is LP. NP and conp. P breakthrough.

5 INTEGER LINEAR PROGRAMMING (ILP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. #-approximation algorithm.

Approximation Algorithms

Linear Programming for Optimization. Mark A. Schulze, Ph.D. Perceptive Scientific Instruments, Inc.

DATA ANALYSIS II. Matrix Algorithms

IEOR 4404 Homework #2 Intro OR: Deterministic Models February 14, 2011 Prof. Jay Sethuraman Page 1 of 5. Homework #2

Module1. x y 800.

Proximal mapping via network optimization

2.3 Convex Constrained Optimization Problems

Special Situations in the Simplex Algorithm

26 Linear Programming

Simplex method summary

Interior Point Methods and Linear Programming

Mathematical finance and linear programming (optimization)

Algorithm Design and Analysis

Optimization in R n Introduction

Linear Programming. April 12, 2005

Equilibrium computation: Part 1

24. The Branch and Bound Method

Largest Fixed-Aspect, Axis-Aligned Rectangle

LECTURE: INTRO TO LINEAR PROGRAMMING AND THE SIMPLEX METHOD, KEVIN ROSS MARCH 31, 2005

Optimization Modeling for Mining Engineers

Operation Research. Module 1. Module 2. Unit 1. Unit 2. Unit 3. Unit 1

Linear Programming: Theory and Applications

Adaptive Linear Programming Decoding

1 VECTOR SPACES AND SUBSPACES

This exposition of linear programming

Actually Doing It! 6. Prove that the regular unit cube (say 1cm=unit) of sufficiently high dimension can fit inside it the whole city of New York.

3.1 Solving Systems Using Tables and Graphs

OPRE 6201 : 2. Simplex Method

11. APPROXIMATION ALGORITHMS

International Doctoral School Algorithmic Decision Theory: MCDA and MOO

9.4 THE SIMPLEX METHOD: MINIMIZATION

Warshall s Algorithm: Transitive Closure

Sensitivity Analysis with Excel

Lecture 11: 0-1 Quadratic Program and Lower Bounds

Chapter 6. Linear Programming: The Simplex Method. Introduction to the Big M Method. Section 4 Maximization and Minimization with Problem Constraints

Airport Planning and Design. Excel Solver

1 Norms and Vector Spaces

Solving Curved Linear Programs via the Shadow Simplex Method

CHAPTER 9. Integer Programming

Lecture 13 Linear quadratic Lyapunov theory

Sensitivity Analysis 3.1 AN EXAMPLE FOR ANALYSIS

EXCEL SOLVER TUTORIAL

Linear Programming. Solving LP Models Using MS Excel, 18

Minimum cost maximum flow, Minimum cost circulation, Cost/Capacity scaling

Binary Image Reconstruction

NP-Hardness Results Related to PPAD

Duality of linear conic problems

Approximating Minimum Bounded Degree Spanning Trees to within One of Optimal

Chapter 6. Cuboids. and. vol(conv(p ))

3.3. Solving Polynomial Equations. Introduction. Prerequisites. Learning Outcomes

Some representability and duality results for convex mixed-integer programs.

Algebra 2 Chapter 1 Vocabulary. identity - A statement that equates two equivalent expressions.

Definition Given a graph G on n vertices, we define the following quantities:

THE NUMBER OF GRAPHS AND A RANDOM GRAPH WITH A GIVEN DEGREE SEQUENCE. Alexander Barvinok

Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar

0.1 Linear Programming

Scheduling Shop Scheduling. Tim Nieberg

Duality in General Programs. Ryan Tibshirani Convex Optimization /36-725

Linear Programming in Matrix Form

Nonlinear Programming Methods.S2 Quadratic Programming

Nonlinear Optimization: Algorithms 3: Interior-point methods

Solving Linear Programs

Optimization Methods in Finance

Introduction to Linear Programming (LP) Mathematical Programming (MP) Concept

Minkowski Sum of Polytopes Defined by Their Vertices

Standard Form of a Linear Programming Problem

Date: April 12, Contents

How To Solve The Line Connectivity Problem In Polynomatix

Lecture 7: Finding Lyapunov Functions 1

Linear Programming: Chapter 11 Game Theory

CHAPTER 11: BASIC LINEAR PROGRAMMING CONCEPTS

Transcription:

Linear Programming Widget Factory Example Learning Goals. Introduce Linear Programming Problems. Widget Example, Graphical Solution. Basic Theory:, Vertices, Existence of Solutions. Equivalent formulations. Outline of Simplex Method. Runtimes for Linear Program Solvers. Readings: Read text section 11.6, and sections 1 and 2 of Tom Ferguson s notes (see course homepage). A factory makes (thousand) widgets of type 1 and of type 2. Total profit for making x = (, ) T is: profit = + 2 Due to a limited resource (e.g. time) we require: + 4 Two waste products from making widget 1 are required for widget 2. So we need to make enough of widget 1 to supply the construction of widget 2. These constraints are: - + 1-3 + 10 15 Finally, both and must be non-negative. How many widgets of each type should be made to maximize profit? 1 2 Linear Programming: Standard Form Widget Factory Example: Continued. Consider a real-valued, unknown, n-vector x = (,,, x n ) T. A linear programming problem in standard form (A, b, c) has the three components: Constants: A an m x n matrix, b an m vector, Objective Function: We wish to choose x to maximize: c an n vector. c T x = c 1 + c 2 + c n x n Linear function of x with x subject to the following constraints: Pose Widget problem as a linear program in Standard Form. Need to specify constants, (A, b, c). Unknowns: x = (, ) T number (in thousands) of the two widget types. Objective function (profit): c T x = c 1 + c 2 = + 2, so c T = (c 1, c 2 ) = (1, 2). A x b For an m x n matrix A, and an m vector b: A x b so Non-negativity Constraints: x 0 Linear inequality constraints on x Notation: For two K-vectors x and y, x y iff x k y k for each k = 1, 2,, K. Other inequalities (, etc.) defined similarly. Non-negativity Constraints: x 0 3 4

Graphing the Widget Factory Example Graphing the Widget Factory Example Linear Program specified by (A, b, c). Example: x = (, ) T. Linear Program specified by (A, b, c). Ax b, - + 1 c T x = 4 c T x increases in direction c. + 4-3 + 10 15 Mixtures of widgets with the same profit c T x = 2 Non-negativity: x 0. 5 6 Graphing the Widget Factory Example Graphing the Widget Factory Example Example: x = (, ) T. Linear Program specified by (A, b, c). Example: x = (, ) T. Linear Program specified by (A, b, c). Ax b, Ax b, Max profit: c T x Non-negativity: x 0. Direction of increasing profit. Non-negativity: x 0. 7 8

Graphing the Widget Factory Example Linear Programming: Example Applications Example: x = (, ) T. Linear Program specified by (A, b, c). Linear programming is quite a general framework. For example: Ax b, Network flow problems can be written as linear programs (LPs) for the unknown flow f(e). The constraints are: 0 f(e) c(e). flow conservation at each v є V\{s,t}. f ( e) f ( e) 0 e in to v e out of v Non-negativity: x 0. Optimal Solution: x T = (25, 27)/13 which can be rewritten as LHS 0, and LHS 0. The objective function is max sum{ f(e) e = (s, v), v є V } Integer Linear Programming. Weighted scheduling problems, the Knapsack problem, etc. can also be written as LPs, although for these we seek integer valued solutions. 9 10 Linear Programming Theory: Example Given the constants (A, b, c), consider the linear program: Objective Function: Maximize c T x, where x = (,,, x n ) T. A x b Non-negativity Constraints: x 0 - + 1 Define the feasible set F = { x Ax b and x 0 }. F could be empty (no solutions to all the constraints). F is a convex polytope. (A region of [R n defined by the intersection of finitely many half-spaces, e.g., a T k x b k and x j 0.) Convexity of F: Let u, v є F, and let s є [0, 1]. Then su + (1-s)v є F. + 4-3 + 10 15 Pf: u, v є F implies Au b and Av b. So A [su + (1-s)v ] = s Au + (1-s)Av sb + (1-s)b = b, for s є [0, 1]. A similar argument shows su + (1-s)v 0. Therefore su + (1-s)v є F. 11 12

Example Example - + 1 - + 1 unbounded + 4 10-15 - - -4 10-15 13 14 Linear Programming Theory: Characterization of a Vertex Three Dimensional Example: Vertices What s a vertex of the feasible set? Let P be the (m+n) x n matrix and p the (m+n)-vector which represents both the problem and non-negativity constraints: Vertex: Choose n = 3 problem or non-negativity constraints, solve equalities for v: x 3 + 3x 3 600 + x 3 300 + + x 3 400 250 Let s = {s 1, s 2,, s n } be a selection of n row numbers, 1 s i m+n. Define Q(s) to be the n x n matrix formed from the s-rows of P, and q(s) the n-vector formed from the same rows of p. Defn: A point v є [R n is a vertex of the feasible set F iff there exists an s such that: Q(s) is nonsingular, v = [Q(s)] -1 q(s), i.e., v satisfies the n equalities selected by s, and v є F, i.e., v is feasible. See 2D examples above, and 3D example next. Feasible set F is this closed polytope. Vertex is a soln of: + 3x 3 = 600 + + x 3 = 400 = 0 Vertex is a soln of: + 3x 3 = 600 + x 3 = 300 + + x 3 = 400 15 16

Linear Programming Theory: Characterization of a Solution Solution at Vertex: Example 1 Given the constants (A, b, c), consider the linear program: Objective Function: Maximize c T x, where x = (,,, x n ) T, c 0. A x b Non-negativity Constraints: x 0 - + 1 Define: Feasible set F = { x A x b and x 0 } Theorem: The linear program above either: 1. has no solution, in which case either the feasible set F is empty, or the objective c T x unbounded (and F is unbounded), 2. has a solution x*. In case 2, x* can be taken to be a vertex of the polytope F (there may also be non-vertex solutions x є F with c T x = c T x*) + 4 Optimal solution at vertex. -3 + 10 15 See examples. 17 18 Solution at Vertex: Example 2 Solution along Closed Segment: Example - + 1 - + 1 + 4 Optimal solution at vertex. + 4 Optimal solutions at vertices and along segment between. -3 + 10 15-3 + 10 15 c must be special for such a case to occur. 19 20

Three Dimensional Example Variations in the Formulation of Linear Programs Colours indicate value of c T x. Larger c T x hotter colours. Feasible set F is this closed polytope. x 3 + 3x 3 600 + x 3 300 + + x 3 400 250 Maximize c T x, c T = (2, 3, 4), Multiple solns iff c is perpendicular to an edge or face of F. A given LP can be expressed in many equivalent forms. Given an LP in standard form, with constants (A, b, c). Some alternatives: minimize c T x equivalent to maximizing c T x. Constraint a T x b equivalent to -a T x -b Constraint a T x = b iff a T x b and a T x -b. Ax b iff Ax + z = b and z 0, with slack variables z = (z 1,, z m ) T. min e can be rewritten as min(e + + e -) with the linear constraint e = e + -e - and the non-negativity constraint e +, e - 0. These alternatives are useful for posing problems as LPs in standard form, or reposing LPs in alternative forms useful for computation. 21 22 A Sketch of the Simplex Method Three Dimensional Example: Revisited Simplex method: Given an LP in standard form (A, b, c). Let P and p be: Let v be a feasible vertex. So v = v(s), where s = {s 1,, s n } denotes a set of n selected rows of P v p, such that Q(s) v = q(s) and Q(s) is nonsingular (see the defn. of a vertex, above). while true * Consider each neighbour s of s (i.e., s and s differ only in one element.). Choose an edge v(s) to v(s ) s.t. the objective increases. If there is no such edge, v(s) is a solution. Stop. If there is an edge leaving v(s) on which the objective is unbounded, then there is no solution to this LP. Stop. Set s s, v v (s ) end * Modulo non-cycling conditions Feasible set F is this closed polytope. x 3 + 3x 3 600 + x 3 300 + + x 3 400 250 Maximize c T x, c T = (2, 3, 4), c T x gives shading. Multiple solns iff c is perpendicular to an edge or face of F. 23 24

Pivoting Obtaining an Initial Vertex The step from v(s) to v(s ) is called pivoting. One row of Pv p is dropped from s, and it is replaced by another row to form s. The selection of a pivot is guaranteed not to decrease the objective function. We need an initial feasible vertex to start the Simplex Algorithm. Given the LP constants (A, b, c), consider the start-up LP: Objective Function: Maximize -z -z m, where z = (z 1, z 2,, z m ) T. Equivalent to minimizing z 1 + +z m A x - z b, Non-negativity Constraints: x, z 0 If some care is taken to avoid cycling, the Simplex Algorithm is guaranteed to converge to a solution after finitely many pivot steps. In an efficient implementation, each pivot step costs O((m+n)n) real number operations. Unfortunately, simplex may visit exponentially many vertices in contrived cases. E.g., number of choices for s, (n+m) choose n. For this start-up LP we have the initial guess, x = 0, z = b - where b k - =-bk if b k < 0 and 0 otherwise. This start-up LP has a solution (x 0, 0) (i.e., with z = 0 and the objective function equal to 0) iff x 0 is a feasible solution of the original LP. Simplex will return a feasible vertex x 0 on this start-up LP, so long as the original feasible set F is not empty. 25 26 Runtime for Simplex Algorithm Runtimes for Linear Programming Solvers Worst case runtime is exponential. The Simplex Algorithm might visit exponentially many vertices as m and n grow. In practice: the method is highly efficient, typically requires a number of steps which is just a small multiple of the number of variables. LPs with thousands or even millions of variables are routinely solved using the simplex method on modern computers. efficient, highly sophisticated implementations are available. Interior point methods provided the first polynomial time algorithms known for LP. These iterate through the interior of the feasible set F. Ellipsoid algorithm, Khachiyan, 1979. Interior point projective method, Karmarkar, 1984. Interior point methods are now generally considered competitive with the simplex method in most, though not all, applications. Sophisticated software packages are available. Integer Linear Programming (ILP): An LP problem but with the added constraint that the solution vector x must be integer valued. ILP is NP-hard. 27 28

Linear Programming Learning Goals. Basic Linear Programming Theory:, Vertices, Existence of Solutions. Equivalent formulations. Outline of the Simplex Method. Runtimes Readings: Read text section 11.6, and sections 1 and 2 of Tom Ferguson s notes (see course homepage). Next Lectures: Duality in Linear Programs (sec. 2, Ferguson s notes). Begin approximation algorithms, Chapter 11. 29