Today: Linear Programming

Similar documents
An example of LP problem: Political Elections

29 Linear Programming

III. Linear Programming

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

Today: Linear Programming (con t.)

MS-E2140. Lecture 1. (course book chapters )

Math 5593 Linear Programming Week 1

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

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

MS-E2140. Lecture 1. (course book chapters )

Lecture 1 Introduction

COT 6936: Topics in Algorithms! Giri Narasimhan. ECS 254A / EC 2443; Phone: x3748

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

Optimization (168) Lecture 7-8-9

CSC Design and Analysis of Algorithms. LP Shader Electronics Example

Theory and Internet Protocols

CSCI 5654 (Linear Programming, Fall 2013) CSCI 5654: Linear Programming. Notes. Lecture-1. August 29, Notes

Linear programming: algebra

Lesson 27 Linear Programming; The Simplex Method

COMP3121/9101/3821/9801 Lecture Notes. Linear Programming

LINEAR PROGRAMMING II

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

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

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

Algorithmic Game Theory and Applications. Lecture 7: The LP Duality Theorem

Topics in Theoretical Computer Science April 08, Lecture 8

The simplex algorithm

Another max flow application: baseball

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

Lecture slides by Kevin Wayne

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

CS711008Z Algorithm Design and Analysis

Lecture 13: Linear programming I

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

MAT016: Optimization

Section #2: Linear and Integer Programming

0.1 O. R. Katta G. Murty, IOE 510 Lecture slides Introductory Lecture. is any organization, large or small.

15-780: LinearProgramming

Initial feasible origin: 1. Set values of original variables to zero. 2. Set values of slack variables according to the dictionary.

An introductory example

A Parametric Simplex Algorithm for Linear Vector Optimization Problems

Simplex Method for LP (II)

3. Linear Programming and Polyhedral Combinatorics

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

IE 5531: Engineering Optimization I

Theoretical questions and problems to practice Advanced Mathematics and Statistics (MSc course)

Mathematical Optimisation, Chpt 2: Linear Equations and inequalities

Introduction to optimization

The Simplex Algorithm

Resource Constrained Project Scheduling Linear and Integer Programming (1)

Optimisation and Operations Research

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

1 Review Session. 1.1 Lecture 2

BBM402-Lecture 20: LP Duality

A Redundant Klee-Minty Construction with All the Redundant Constraints Touching the Feasible Region

3. Linear Programming and Polyhedral Combinatorics

Example Problem. Linear Program (standard form) CSCI5654 (Linear Programming, Fall 2013) Lecture-7. Duality

Massachusetts Institute of Technology 6.854J/18.415J: Advanced Algorithms Friday, March 18, 2016 Ankur Moitra. Problem Set 6

Linear Programming. Linear Programming. Brewery Problem: A Toy LP Example. Applications

IP Cut Homework from J and B Chapter 9: 14, 15, 16, 23, 24, You wish to solve the IP below with a cutting plane technique.

GETTING STARTED INITIALIZATION

The Transform and Conquer Algorithm Design Technique

Complexity of linear programming: outline

Linear Programming Inverse Projection Theory Chapter 3

Chapter 1 Linear Programming. Paragraph 5 Duality

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

Today s class. Constrained optimization Linear programming. Prof. Jinbo Bi CSE, UConn. Numerical Methods, Fall 2011 Lecture 12

Discrete Optimization

Sensitivity Analysis and Duality

x 1 + x 2 2 x 1 x 2 1 x 2 2 min 3x 1 + 2x 2

3. Vector spaces 3.1 Linear dependence and independence 3.2 Basis and dimension. 5. Extreme points and basic feasible solutions

! Fast commercial solvers: CPLEX, OSL. ! Powerful modeling languages: AMPL, GAMS. ! Ranked among most important scientific advances of 20 th century.

Operations Research: Introduction. Concept of a Model

UNIT-4 Chapter6 Linear Programming

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

Lecture Note 18: Duality

EE364a Review Session 5

AM 121: Intro to Optimization Models and Methods

Linear Programming. H. R. Alvarez A., Ph. D. 1

7 th Grade Algebra & Geometry Main Lesson Lesson Plan Outline

In Chapters 3 and 4 we introduced linear programming

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

Linear Programming. Chapter Introduction

Chapter 6. Linear Programming: The Simplex Method. 6.1 Geometric Introduction to the Simplex Method

DOWNLOAD PDF LINEAR OPTIMIZATION AND APPROXIMATION

Duality. Peter Bro Mitersen (University of Aarhus) Optimization, Lecture 9 February 28, / 49

Review Solutions, Exam 2, Operations Research

1 The linear algebra of linear programs (March 15 and 22, 2015)

ECE 307 Techniques for Engineering Decisions

Notes taken by Graham Taylor. January 22, 2005

LINEAR PROGRAMMING. Relation to the Text (cont.) Relation to Material in Text. Relation to the Text. Relation to the Text (cont.

Linear programs, convex polyhedra, extreme points

Linear Programming: Simplex

Simplex Algorithm Using Canonical Tableaus

Linear Programming. 1 An Introduction to Linear Programming

IE 5531: Engineering Optimization I

Optimisation and Operations Research

Linear Programming Duality

Lecture 3: Semidefinite Programming

9.5 THE SIMPLEX METHOD: MIXED CONSTRAINTS

Transcription:

Today: Linear Programming COSC 581, Algorithms March 27, 2014 Many of these slides are adapted from several online sources

Today s class: Chapter 29.1 Reading Assignments Reading assignment for next Thursday s class: Chapter 29.2-3 Announcement: Exam #2 on Tuesday, April 1 Will cover greedy algorithms, amortized analysis HW 6-9

Linear Programming Example: A Political problem Suppose a politician is trying to win an election 3 types of areas --- urban, suburban, rural Certain issues --- roads, gun control, farm subsidies, gasoline tax Politician wants to find out the minimum amount of money he/she needs to win 50,000 urban, 100,000 suburban, 25,000 rural votes. The effects of policies on votes: Policy urban suburban rural Build roads -2 5 3 Gun control 8 2-5 Farm subsidies 0 0 10 Gasoline tax 10 0-2

How to Solve? Define 4 variables : x 1 is the # of thousands of dollars spent on advertising on building roads x 2 is the # of thousands of dollars spent on advertising on gun control x 3 is the # of thousands of dollars spent on advertising on farm subsidies x 4 is the # of thousands of dollars spent on advertising on gasoline tax We format this problem as a linear program: Minimize: x 1 + x 2 + x 3 + x 4 // Total spent Subject to: 2x 1 + 8x 2 + 0x 3 + 10x 4 50 // urban votes 5x 1 + 2x 2 + 0x 3 + 0x 4 100 // suburb. votes 3x 1 5x 2 + 10x 3 2x 4 25 // rural votes x 1, x 2, x 3, x 4 0 // can t have negative costs The solution of this linear program will yield an optimal strategy for the politician.

Applications of Linear Programming LP is a widely used Mathematical Optimization Model: Used frequently in management science (operations research), engineering, technology, industry, commerce, economics. Efficient resource allocation technique: Airline transportation Communication networks e.g., optimize transmission routing Factory inventory/production control Fund management, stock portfolio optimization Can be used to approximate hard optimization problems...

History of LP 3000-200 BC: Egypt, Babylon, India, China, Greece: [geometry & algebra] Egypt: polyhedra & pyramids. India: Sulabha suutrah (Easy Solution Procedures) [2 equations, 2 unknowns] China: Jiuzhang suanshu (9 Chapters on the Mathematical Art) [Precursor of Gauss-Jordan elimination method on linear equations] Greece: Pythagoras, Euclid, Archimedes, 825 AD: Persia: Muhammad ibn-musa Alkhawrazmi (author of 2 influential books): Al-Maqhaleh fi Hisab al-jabr w almoqhabeleh (An essay on Algebra and equations) Kitab al-jam a wal-tafreeq bil Hisab al-hindi (Book on Hindu Arithmetic). originated the words algebra & algorithm for solution procedures of algebraic systems. Fourier [1826], Motzkin [1933] [Fourier-Motzkin elimination method on linear inequalities] Minkowski [1896], Farkas [1902], De la Vallée Poussin [1910], von Neumann [1930 s], Kantorovich [1939], Gale [1960] [LP duality theory & precursor of Simplex] George Dantzig [1947]: Simplex algorithm. Exponential time in the worst case, but effective in practice. Leonid Khachiyan [1979]: Ellipsoid algorithm. The first weakly polynomial-time LP algorithm: poly(n,d,l). Narendra Karmarkar [1984]: Interior Point Method. Also weakly polynomial-time. IPM variations are very well studied. Megiddo-Dyer [1984]: Prune-&-Search method. O(n) time if the dimension is a fixed constant. Super-exponential on dimension.

The General LP Problem maximize c x c x + + 1 1 + 2 2 c d x d Linear objective function subject to: a a 11 21 x x 1 1 + a + a 12 22 x x 2 2 + + + + a a 1d 2d x d x d b 1 b 2 Linear constraints (stated as inequalities) a n1 x 1 + a n2 x 2 + + a nd x d b n

Some terminology Objective function: value measure used to rank alternatives; either minimize or maximize this objective Decision variables: the quantities you can control to improve your objective function; should completely describe the set of decisions to be made Constraints: limitations on the values of the decision variables Linear program: a mathematical program in which the objective function is a linear function and the constraints are linear equalities or inequalities Objective value: value of objective function at a particular point Feasible solution: satisfies all the constraints Infeasible solution: doesn t satisfy the constraints Optimal solution: best feasible solution Unbounded solution: solution to LP does not have finite objective value

General Idea of LP via another example LP Idea: Minimize or maximize a linear objective, Subject to linear equalities and inequalities Example: Bubba is in a pie eating contest that lasts 1 hour. Each torte that he eats takes 2 minutes. Each apple pie that he eats takes 3 minutes. He receives 4 points for each torte and 5 points for each pie. What should Bubba eat so as to get the most points? Step 1: Determine the decision variables: Let x be the number of tortes eaten by Bubba Let y be the number of pies eaten by Bubba

General Idea of LP (con t) Step 2: Determine the objective function: Maximize z = 4x + 5y Step 3: Determine the constraints: 2x + 3y 60 // time constraints x 0; y 0 // non-negativity constraints i.e., can t eat negative amounts

Visualizing LP -- Example in 2D max x 1 + 8x 2 x 2 x 1 = 46/7 x 2 = 59/7 subject to: (1) x 1 3 (2) x 2 2 (3) 3x 1 + 4x 2 14 (4) 4x 1 3x 2 25 (5) x 1 + x 2 15 (1) (3) Feasible Region (2) (5) (4) x 1 Each constraint is represented by a line and a direction. Intersection of constraints is feasible region.

Visualizing LP -- Example in 3D maximize z z Optimum (x,y,z)=(0,0,3) subject to: x+ y + z 3 y 2 y x 0 y z 0 0 x

Multi-dimensional cases (beyond 3D) Can t visualize beyond 3D, but same idea holds Each constraint defines half-space in n-dimensional space The objective function is a hyperplane Feasible region is area formed by intersection of half-spaces This region is called a simplex

Important Observation: Optimal Solutions are at a Vertex or Line Segment Intersection of objective function and feasible region is either vertex or line segment z Optimum (x,y,z)=(0,0,3) Feasible Region y Feasible region is convex makes optimization much easier! Simplex algorithm finds LP solution by: Starting at some vertex Moving along edge of simplex to neighbor vertex whose value is at least as large Terminates when it finds local maximum Convexity ensures this local maximum is globally optimal x

Recall History of LP 3000-200 BC: Egypt, Babylon, India, China, Greece: [geometry & algebra] Egypt: polyhedra & pyramids. India: Sulabha suutrah (Easy Solution Procedures) [2 equations, 2 unknowns] China: Jiuzhang suanshu (9 Chapters on the Mathematical Art) [Precursor of Gauss-Jordan elimination method on linear equations] Greece: Pythagoras, Euclid, Archimedes, 825 AD: Persia: Muhammad ibn-musa Alkhawrazmi (author of 2 influential books): Al-Maqhaleh fi Hisab al-jabr w almoqhabeleh (An essay on Algebra and equations) Kitab al-jam a wal-tafreeq bil Hisab al-hindi (Book on Hindu Arithmetic). originated the words algebra & algorithm for solution procedures of algebraic systems. Fourier [1826], Motzkin [1933] [Fourier-Motzkin elimination method on linear inequalities] Minkowski [1896], Farkas [1902], De la Vallée Poussin [1910], von Neumann [1930 s], Kantorovich [1939], Gale [1960] [LP duality theory & precursor of Simplex] George Dantzig [1947]: Simplex algorithm. Exponential time in the worst case, but effective in practice. Leonid Khachiyan [1979]: Ellipsoid algorithm. The first weakly polynomial-time LP algorithm: poly(n,d,l). Narendra Karmarkar [1984]: Interior Point Method. Also weakly polynomial-time. IPM variations are very well studied. Our study while not polynomial, can be fast in practice; variants are commonly used today Megiddo-Dyer [1984]: Prune-&-Search method. O(n) time if the dimension is a fixed constant. Super-exponential on dimension.

Consider the following linear programming problem: Maximize: x+ y Subject to: x+ y 2 2x+ y 6 x+ 2y 6 xy, 0 What does the feasible region look like? What is the optimal solution? In-Class exercise

Two Canonical Forms for LP: Standard and Slack An LP is in standard form if it is the maximization of a linear function subject to linear inequalities An LP is in slack form if it is the maximization of a linear function subject to linear equalities

Standard Form We re given: n real numbers c 1, c 2, c n m real numbers b 1, b 2, b m mn real numbers a ii, for i = 1, 2,, m and j = 1, 2, n We want to find: n real numbers x 1, x 2, x n that: Maximize: Subject to: n j=1 n c j x j a ii x j b i j=1 for i = 1, 2,, m x j 0 for j = 1, 2,, n

Compact Version of Standard Form Let: A = a ii be m n matrix b = c = x = b i be an m-vector c j be an n-vector x j be an n-vector Rewrite LP as: Maximize: c T x Subject to: AA b x 0 Now, we can concisely specify LP in standard form as (A, b, c)

Converting LP to Standard Form 4 reasons an LP might not be in standard form: 1) Objective function might be a minimization instead of maximization 2) There might be variables w/o non-negativity constraints 3) There might be equality constraints 4) There might be inequality constraints that are instead of We can convert any LP into an equivalent standard form

Step 1: Change min LP to max LP To convert a minimization linear program L into an equivalent maximization linear program L, we simply negate the coefficients in the objective function. Example:

Step 2: Dealing with missing non-negativity constraints Suppose that some variable x j does not have a nonnegativity constraint. Then: We replace each occurrence of x j by x j x

Step 3: Converting equality constraints into inequality constraints Suppose that a linear program has an equality constraint f (x1, x2,..., xn) = b. Since x = y if and only if both x y and x y, we can replace f (x1, x2,..., xn) = b by: f (x1, x2,...,xn) b and f (x1, x2,..., xn) b.

Step 4: Convert constraints to constraints We can convert the constraints to constraints by multiplying these constraints through by -1. That is, any inequality of the form: is equivalent to: n n a ii x j b i j=1 a ii x j b i j=1

Slack Form Useful for Simplex In slack form, the only inequality constraints are the nonnegativity constraints All other constraints are equality constraints Let: n j=1 a ii x j b i be an inequality constraint Introduce new variable s, and rewrite as: n s = b i a ii x j j=1 s 0 s is a slack variable; it represents difference between left-hand and right-hand sides

Slack Form (con t.) In general, we ll use x n+i (instead of s) to denote the slack variable associated with the ith inequality. The ith constraint is therefore: n x n+i = b i a ii x i j=1 along with the non-negativity constraint x n+i 0

Example Standard form: Slack form: Maximize 2x 1 3x 2 + 3x 3 subject to: x 1 + x 2 x 3 7 x 1 x 2 + x 3 7 x 1 2x 2 + 2x 3 4 x 1, x 2, x 3 0 Maximize 2x 1 3x 2 + 3x 3 subject to: x 4 = 7 x 1 x 2 + x 3 x 5 = 7 + x 1 + x 2 x 3 x 6 = 4 x 1 + 2x 2 2x 3 x 1, x 2, x 3, x 4, x 5, x 6 0

About Slack Form Slack form: Maximize 2x 1 3x 2 + 3x 3 subject to: x 4 = 7 x 1 x 2 + x 3 x 5 = 7 + x 1 + x 2 x 3 x 6 = 4 x 1 + 2x 2 2x 3 x 1, x 2, x 3, x 4, x 5, x 6 0 Basic variables variables on left-hand side Non-basic variables variables on right-hand side

Concise Representation of Slack Form Can eliminate maximize, subject to, and non-negativity constraints (all are implicit) And, introduce z as value of objective function: z = 2x 1 3x 2 + 3x 3 x 4 = 7 x 1 x 2 + x 3 x 5 = 7 + x 1 + x 2 x 3 x 6 = 4 x 1 + 2x 2 2x 3 Then, define slack form of LP as tuple (N, B, A, b, c, v) where N = indices of nonbasic variables B = indices of basic variables We can rewrite LP as: z = v + c j x j j N x i = b i a ii x j for i B j N

In-Class Exercise A bank is open Monday-Friday from 9am to 5pm. From past experience, the bank knows that it needs (at least) the following number of tellers: Time period: 9:00-10:00 10:00-11:00 11:00-12:00 12:00-1:00 1:00-2:00 2:00-3:00 3:00-4:00 4:00-5:00 Tellers required: 4 3 4 6 5 6 8 8 The bank hires two types of tellers. Full time tellers work 9-5 every day, except for 1 hour off for lunch. (The bank determines when a full time teller takes lunch hour, but it must be either 12-1 or 1-2.) Full time employees are paid $8 per hour (this includes payment for the lunch hour). The bank can also hire part time tellers. Each part time teller must work exactly 3 consecutive hours each day, and gets paid $5 per hour. To maintain quality of service, at most 5 part time tellers can be hired. Formulate a LP to minimize the cost of the bank to meet teller requirements.

Reading Assignments Reading assignment for next Thursday s class: Chapter 29.2-3 Announcement: Exam #2 on Tuesday, April 1 Will cover greedy algorithms, amortized analysis HW 6-9