Note nine: Linear programming CSE 101. 1 Linear constraints and objective functions. 1.1 Introductory example. Copyright c Sanjoy Dasgupta 1



Similar documents
f(a + h) f(a) f (a) = lim

Derivatives Math 120 Calculus I D Joyce, Fall 2013

Math 113 HW #5 Solutions

Math Test Sections. The College Board: Expanding College Opportunity

Lecture 10: What is a Function, definition, piecewise defined functions, difference quotient, domain of a function

Verifying Numerical Convergence Rates

Instantaneous Rate of Change:

2 Limits and Derivatives

How To Ensure That An Eac Edge Program Is Successful

M(0) = 1 M(1) = 2 M(h) = M(h 1) + M(h 2) + 1 (h > 1)

SAT Subject Math Level 1 Facts & Formulas

- 1 - Handout #22 May 23, 2012 Huffman Encoding and Data Compression. CS106B Spring Handout by Julie Zelenski with minor edits by Keith Schwarz

ACT Math Facts & Formulas

Projective Geometry. Projective Geometry

The modelling of business rules for dashboard reporting using mutual information

Average and Instantaneous Rates of Change: The Derivative

Tangent Lines and Rates of Change

Geometric Stratification of Accounting Data

2.12 Student Transportation. Introduction

Optimized Data Indexing Algorithms for OLAP Systems

FINITE DIFFERENCE METHODS

The EOQ Inventory Formula

Schedulability Analysis under Graph Routing in WirelessHART Networks

Sections 3.1/3.2: Introducing the Derivative/Rules of Differentiation

New Vocabulary volume

Section 3.3. Differentiation of Polynomials and Rational Functions. Difference Equations to Differential Equations

Catalogue no XIE. Survey Methodology. December 2004

An inquiry into the multiplier process in IS-LM model

1.6. Analyse Optimum Volume and Surface Area. Maximum Volume for a Given Surface Area. Example 1. Solution

The Derivative as a Function

Determine the perimeter of a triangle using algebra Find the area of a triangle using the formula

Comparison between two approaches to overload control in a Real Server: local or hybrid solutions?

2.1: The Derivative and the Tangent Line Problem

CHAPTER 7. Di erentiation

f(x + h) f(x) h as representing the slope of a secant line. As h goes to 0, the slope of the secant line approaches the slope of the tangent line.

Chapter 11. Limits and an Introduction to Calculus. Selected Applications

Chapter 10: Refrigeration Cycles

Pressure. Pressure. Atmospheric pressure. Conceptual example 1: Blood pressure. Pressure is force per unit area:

For Sale By Owner Program. We can help with our for sale by owner kit that includes:

College Planning Using Cash Value Life Insurance

Torchmark Corporation 2001 Third Avenue South Birmingham, Alabama Contact: Joyce Lane NYSE Symbol: TMK

13 PERIMETER AND AREA OF 2D SHAPES


OPTIMAL DISCONTINUOUS GALERKIN METHODS FOR THE ACOUSTIC WAVE EQUATION IN HIGHER DIMENSIONS

Can a Lump-Sum Transfer Make Everyone Enjoy the Gains. from Free Trade?

SWITCH T F T F SELECT. (b) local schedule of two branches. (a) if-then-else construct A & B MUX. one iteration cycle

EC201 Intermediate Macroeconomics. EC201 Intermediate Macroeconomics Problem set 8 Solution

SAMPLE DESIGN FOR THE TERRORISM RISK INSURANCE PROGRAM SURVEY

Solutions by: KARATUĞ OZAN BiRCAN. PROBLEM 1 (20 points): Let D be a region, i.e., an open connected set in

2.23 Gambling Rehabilitation Services. Introduction

a joint initiative of Cost of Production Calculator

MATHEMATICS FOR ENGINEERING DIFFERENTIATION TUTORIAL 1 - BASIC DIFFERENTIATION

Unemployment insurance/severance payments and informality in developing countries

The Dynamics of Movie Purchase and Rental Decisions: Customer Relationship Implications to Movie Studios

Strategic trading in a dynamic noisy market. Dimitri Vayanos

3 Ans. 1 of my $30. 3 on. 1 on ice cream and the rest on 2011 MATHCOUNTS STATE COMPETITION SPRINT ROUND

Binary Search Trees. Adnan Aziz. Heaps can perform extract-max, insert efficiently O(log n) worst case

SAT Math Facts & Formulas

Chapter 7 Numerical Differentiation and Integration

Distances in random graphs with infinite mean degrees

Section 2.3 Solving Right Triangle Trigonometry

CHAPTER TWO. f(x) Slope = f (3) = Rate of change of f at 3. x 3. f(1.001) f(1) Average velocity = s(0.8) s(0) 0.8 0

ANALYTICAL REPORT ON THE 2010 URBAN EMPLOYMENT UNEMPLOYMENT SURVEY

Research on the Anti-perspective Correction Algorithm of QR Barcode

OPTIMAL FLEET SELECTION FOR EARTHMOVING OPERATIONS

Cyber Epidemic Models with Dependences

Theoretical calculation of the heat capacity

Yale ICF Working Paper No May 2005

Shell and Tube Heat Exchanger

Design and Analysis of a Fault-Tolerant Mechanism for a Server-Less Video-On-Demand System

f(x) f(a) x a Our intuition tells us that the slope of the tangent line to the curve at the point P is m P Q =

Human Capital, Asset Allocation, and Life Insurance

6. Differentiating the exponential and logarithm functions

LINEAR INEQUALITIES. less than, < 2x + 5 x 3 less than or equal to, greater than, > 3x 2 x 6 greater than or equal to,

Valve Selection and Sizing

CHAPTER 8: DIFFERENTIAL CALCULUS

Referendum-led Immigration Policy in the Welfare State

THE NEISS SAMPLE (DESIGN AND IMPLEMENTATION) 1997 to Present. Prepared for public release by:

Volumes of Pyramids and Cones. Use the Pythagorean Theorem to find the value of the variable. h 2 m. 1.5 m 12 in. 8 in. 2.5 m

Pre-trial Settlement with Imperfect Private Monitoring

Guide to Cover Letters & Thank You Letters


THE ROLE OF LABOUR DEMAND ELASTICITIES IN TAX INCIDENCE ANALYSIS WITH HETEROGENEOUS LABOUR

TRADING AWAY WIDE BRANDS FOR CHEAP BRANDS. Swati Dhingra London School of Economics and CEP. Online Appendix

Chapter 6 Tail Design

What is Advanced Corporate Finance? What is finance? What is Corporate Finance? Deciding how to optimally manage a firm s assets and liabilities.

Strategic trading and welfare in a dynamic market. Dimitri Vayanos

A strong credit score can help you score a lower rate on a mortgage

In other words the graph of the polynomial should pass through the points

Section 7.2 Linear Programming: The Graphical Method

Multigrid computational methods are

Writing Mathematics Papers

Math 229 Lecture Notes: Product and Quotient Rules Professor Richard Blecksmith

Notes: Most of the material in this chapter is taken from Young and Freedman, Chap. 12.

Chapter 5. Linear Inequalities and Linear Programming. Linear Programming in Two Dimensions: A Geometric Approach

A Multigrid Tutorial part two

Predicting the behavior of interacting humans by fusing data from multiple sources

Area-Specific Recreation Use Estimation Using the National Visitor Use Monitoring Program Data

Factoring Synchronous Grammars By Sorting

4.4 The Derivative. 51. Disprove the claim: If lim f (x) = L, then either lim f (x) = L or. 52. If lim x a. f (x) = and lim x a. g(x) =, then lim x a

Transcription:

Copyrigt c Sanjoy Dasgupta Figure. (a) Te feasible region for a linear program wit two variables (see tet for details). (b) Contour lines of te objective function: for different values of (profit). Te optimal solution is a verte of te polygon, indicated by a little circle. 400 400 300 300 00 00 c = 50000 00 00 c = 60000 c = 0000 0 00 00 300 400 500 600 0 00 00 300 400 500 600 Note nine: Linear programming CSE 0 Linear constraints and objective functions. Introductory eample Suppose tat a company produces two products, and wises to decide te level of production of eac so as to maimize profits. Let be te amount of Product produced every mont, and let be te amount of Product. Eac unit of Product generates a profit of 00 dollars, wile Product is more lucrative, bringing in 600 dollars. Tere are certain limitations on (besides te obvious one, ). First, cannot be more tan 00, and cannot be more tan 300 presumably because of supply limitations. Also, because of labor constraints (fied number of workers), te total amount produced cannot eceed 400. Wat are te best levels of production? We represent te situation by a linear program, as follows: "! # %$ & $ ' ( $ ) Eac constraint is a linear inequality. Te set of solutions *+, wic satisfy tese constraints is called te feasible region, and is precisely te polygon sown in Figure.(a). We wis to maimize te linear function - (called te objective function, wic in tis case represents total profit) over all te points of tis polygon. Figure.(b) sows te contour lines. ( /0 for various values of. Notice tat tey are parallel because tey all ave te same slope. Look at te line for ; te part of tis line lying inside te polygon represents feasible solutions (ie. solutions satisfying

Copyrigt c Sanjoy Dasgupta te constraints) wic all give a profit of dollars. In oter words, tis amount of profit is acievable. Te maimization task is essentially to move te contour line as far upwards as possible (tat is, to increase te profit as muc as possible), as long as it still touces te polygon (as long as tere is a feasible solution wit tat level of profit). Te optimal point is terefore a verte of te polygon.. Continuation Suppose te company now decides to introduce a tird, luury product. Eac unit sold yields a profit of 400 dollars. Te supply restrictions remain te same as before, as do te labor constraints. It turns out tat Product 3 requires some of te same macinery as Product, but uses it tree times more eavily; tis gives a constraint 3 ' 4 $. Here s te new linear program. "! 5 # 6 7 4.. ( ( 4 8 4 4 Tis time tere are tree variables, so te corresponding picture is tree-dimensional (Figure.). Te feasible region is a polyedron, eac of wose faces is a particular constraint. Te optimum, as before, is at a verte..3 Linear Programming A general linear program is given by linear constraints (using 9 $ :;< ) and a linear objective function (eiter to be maimized or minimized). Tere are tree possibilities for te feasible region.. Te feasible region is a bounded polyedron. In tis case, te optimum solution is at a verte of tis polyedron. It could be te case tat an entire face of te polyedron acieves te optimum value (can you come up wit an eample of tis?), in wic case any of its vertices will do.. Te feasible region is unbounded. Here s a simple eample:.. =. (Can you draw it?) In tis case, te optimum solution migt lie at a verte wit finite coordinates. Or, it migt lie at infinity. 3. Tere is no feasible region. Tat is, te constraints cannot be satisfied.

Copyrigt c Sanjoy Dasgupta 3 Figure. Te feasible region for tis 3-variable linear programming problem is a polyedron, and te optimal solution (indicated wit a little circle) is one of its vertices. Te arrows sow a possible sequence of vertices troug wic te simple algoritm migt iterate, starting wit te origin. 3 Any linear program can be solved by a illclimbing procedure called te simple algoritm. It starts from any verte (of te feasible polyedron) and repeatedly moves to an adjacent verte of better objective value, if one eists. Wen it gets to a verte wit no better neigbor, it stops: tis is te optimal solution. It also detects cases and 3 above. Network flow Consider te network of Figure.. A flow > in tis network consists of flows along eac edge: >?A@ B> @BC, etc. In order to be valid, suc a flow must satisfy capacity constraints: $ >?D@E$' $ >?AF $ $ > @BC $&.

Copyrigt c Sanjoy Dasgupta 4 Figure. A network wit edge capacities. 3 a c s 3 t b d as well as conservation constraints (flow into a node equals flow out of tat node): >?A@6 #> FG@ > @BC >?AF #> CHF > FG@ > FGI. In order to find te maimum flow, we need to maimize >?D@J #>?DF. Notice tat tis is a linear program! In oter words, maimum flow reduces to linear programming. If we ad known tis earlier, we would not ave ad to develop a special algoritm for ma-flow! Actually, in a sense we didn t it turns out tat our algoritm essentially simulates wat simple would do on te LP version of a flow problem. 3 A production sceduling eample We ave demand estimates for our product for all monts of 004 K KL M M MNKO D and tey are very uneven, ranging from 440 to 90. We currently ave 30 employees, eac of wom produces 0 units of te product eac mont at a salary of 000 dollars; we ave no stock of te product. How can we andle suc fluctuations in demand? Tree ways:. overtime, but tis is epensive since it costs 80% more tan regular wages, and as limitations because workers can only put in 30% overtime;. iring and firing, but iring a worker costs 30 dollars, wile firing costs 500; 3. storing surplus, but te wareouse costs are 8 dollars per item per mont. Tis rater elaborate problem can be formulated and solved as a linear program. As in all suc reductions, a crucial first step is defining te variables. PR number of workers during S t mont; PUT '. production in S t mont. V number of items produced by overtime in mont S. W B> number of workers ired/fired at te beginning of mont S. X amount stored at te end of mont S ; X T 0.

Copyrigt c Sanjoy Dasgupta 5 We must now write te constraints. Te total amount produced per mont consists of regular production plus overtime, & P V M Te number of workers can potentially cange at te start of eac mont, and can of course never be negative. P P +Y W Z > P [> W \ M Te amount stored at te end of eac mont is wat we started wit, plus te amount we produced, minus te demand for te mont. X X ]Y ( Z K X M And overtime is limited, $ V $ P M Finally, wat is te objective function? It is to minimize te total cost, ^`_ & 8a P ' & 8a W #b 8a > #ca X 7 c 8a V M One ting wort pointing out is tat te optimal solution need not be integral. It migt be to fire M ' workers, or to make )L& d Meb items. In tis case, we must judiciously round off te answers fire 0 workers, for instance. Some LP packages enable you to interactively try out different rounding scemes. 4 Boolean formulas: a case were LP fails A Boolean formula applies f and, or, notg operations to its inputs and returns a Boolean answer. As an eample, if *+.ij, k*+ mln*+iopj,, oq* mlril j, ten *s,, taking 0 to mean false and to mean true. In tis formula, te variables are.ij. A literal is a variable or te negation of a variable: for instance,. ijo M M M. Tere is a vast diversity of possible Boolean formulas, and it is terefore convenient to require tat tey be written in a standardized format. A popular option is conjunctive normal form (CNF): and-of-or s. Our eample above can be rewritten as *+.ij, k*+ lti, oq*+ lrj, oq* ulpiel j, M Indeed, any Boolean formula can be put into tis form, ve owvj8on oyv6z, were eac clause v is an or of literals. Different clauses can ave vastly different sizes: one migt ave 00 literals wile anoter as only tree. A furter standardization is to restrict clauses to at most 3 literals, and tis is called 3CNF. Here is a simple question one migt ask about Boolean formulas. 3SAT Input: Boolean formula uestion: Is *+. M M M} {, )? *+ M M M {, in 3CNF. satisfiable (is tere an assignment 5 M M M} {~qf} "g for wic

Copyrigt c Sanjoy Dasgupta 6 Our toy formula is satisfiable, for eample wit te assignment iq j=q (many oter assignments work too). How do we solve tis problem in general? Let s try epressing it as a linear program. Eac variable must be eiter 0 or ; for our eample, we can write tis as $ $ [ $ i $ [ $ j $ M We also want eac clause to be satisfied. Noting tat is just Z, te relevant constraints, one per clause, are: u (i u (j * Z, (ie ƒ* Z j, M Is it true tat any feasible solution to tese linear inequalities is a satisfying assignment of? Sadly, tis is not te case: just set all variables to /. And so 3SAT cannot be solved in tis way. Te lack of integrality wic was just a minor inconvenience in our previous application turns out to completely derail tis one. In fact, te news gets muc worse. () It is strongly believed tat tere is no polynomial-time algoritm for 3SAT.