700 likes | 839 Views
Mathematical Programming. Linear Programmin g. T hree Goals in this Chapter. Learn the principle of Simplex-Algorithm Learn how to formulate pbs as LP’s Like brainteasers: can be fun Many problems that do not look like stereotypical “product mix” problems can be formulated as LP’s
E N D
Mathematical Programming Linear Programming
Three Goals in this Chapter • Learn the principle of Simplex-Algorithm • Learn how to formulate pbs as LP’s • Like brainteasers: can be fun • Many problems that do not look like stereotypical “product mix” problems can be formulated as LP’s • Spotting LP’s is an art • Learn how to implement and solve LP’s in Excel
LP Models Linear Programming
LP Model An optimization model is a linear program (or LP) if it has continuous variables, a single linear objective function, and all constraints are linear equalities or inequalities.
LP Model • Linearity • Divisibility (Continuous) • Assumption of Certainty
Linear Programming For purposes of describing and analyzing algorithms, the problem is often stated in the standard form where x is the vector of n unknowns, c is the n dimensional cost vector, and A the constraint matrix (m rows and n columns).
Steps in Formulating a Linear Programming Problem • Understand the problem • Identify the Decision Maker (DM) • Identify the decision variables • State the obj. function as a linear combination of the decision variables • State the constraints as a linear combination of the decision variables • Identify upper or lower bounds on DV’s
Solving and Sensitivity Linear Programming
Linear Programming Each constraint (equation) defines a straight line in the space of the unknowns x The feasible region described by the constraints is a polytope, or simplex, and at least one member of the solution set lies at a vertex of this polytope
Ways of Solving an LP • Graphical Method • Enumerating all extreme points • Simplex method invented by G. Dantzig • Specialized software such as LINDO • General software such as Excel solver • Interior point methods of the sort proposed by Karmarkar • Specialized algorithms for special types of LP’s
Sensitivity Analysis of LP’s • Simplex Method is a standard way to solve linear programs • Its solution yields a “simplex tableau” with “dual variables” which solve a closely related “dual” problem & which contain sensitivity analysis information for original problem concerning • How much could obj. fn. coefficients change without changing optimal solution? • How would changing RHS values affect value of optimal solution? • By how much could one change the RHS values without changing the pattern (“nature”) of optimal solution? • Would it be optimal to produce a new product if it were available?
Simplex-Based Sensitivity Analysis is Very Limited • Can’t see “around corners” • Only relevant for linear programs • Was more relevant before CPU cycles became cheap • Now more convenient to solve iteratively and plot results, e.g., with • Spider Table • Solver Table
Various types of LP Models Linear Programming
Next Topic: Learning How to Formulate LP’s • Getting dec vars right is often the key • Don’t reinvent the wheel; get familiar with common types of LP’s • Many problems are variants on these common types • Many other problems have components which are similar to one or more of the common types • There are “tricks” for linearizing things that aren’t naturally linear • No substitute for practice
Review of Common Types of LP Pbs. 1) Product mix problems 2) Make vs. buy 3) Investment/Portfolio allocation pbs 4) Scheduling 5) Transportation/Assignment problems 6) Blending 7) Multi-period planning 8) Cutting stock problems
Review of Common Types of LP Pbs. 1) Product mix problems 2) Make vs. buy 3) Investment/Portfolio allocation pbs 4) Scheduling 5) Transportation/Assignment problems 6) Blending 7) Multi-period planning 8) Cutting stock problems
#1: Product Mix Decisions(Like the Howie’s Problem) • Decision: How many of each type of product should be made (offered) • Decision variables • Xi = amount of product i to make (offer) • Typical Constraints • Nonnegative production • Production capacity constraints (i.e, limits on resources which are consumed in the process of producing products) • Objective: Maximize profit (or min cost)
Review of Common Types of LP Pbs. 1) Product mix problems 2) Make vs. buy 3) Investment/Portfolio allocation pbs 4) Scheduling 5) Transportation/Assignment problems 6) Blending 7) Multi-period planning 8) Cutting stock problems
#2: Make vs. Buy Decisions • Several products, each can be made in house or purchased from vendors • Decision: Not just how much of each product to obtain but also how much to make and how much to buy, so ... • Decision variables for each product i: • Mi = amount of product i to make in house • Bi = amount of product i to purchase
Make vs. Buy Decisions • Constraints • Meet demand • Production capacity constraints • Nonnegativity • Objective: Minimize cost (or max profit) • Examples • CHAMPUS (Civilian Health and Medical Program of the Uniformed Services) • Outsourcing/privatization • Staffing courses with adjuncts
Make vs. Buy DecisionsMore General Perspective • Several products, each can be obtained through one or more sources • Decision variables • Xij = amount of product i obtained from source j • Constraints • Supply constraints on each source j • Demand constraints on each product i • Production capacity constraints • Nonnegativity
Review of Common Types of LP Pbs. 1) Product mix problems 2) Make vs. buy 3) Investment/Portfolio allocation pbs 4) Scheduling 5) Transportation/Assignment problems 6) Blending 7) Multi-period planning 8) Cutting stock problems
#3: Investment/Portfolio Allocation • Pool of resources (e.g., money or workers) needs to be allocated across a number of available “instruments” • Decision: how much to put (e.g., invest) in each instrument, so ... • Decision variables for each product i: • Xi = amount of invested in instrument i
Investment/Portfolio Allocation Decisions • Constraints • All resources allocated • Diversity constraints on amount invested in any one instrument or type of instrument • Nonnegativity • Objective: Maximize return/benefit • Examples • Dollars to financial investments • Dollars to development projects • Staff/personnel to work projects
Review of Common Types of LP Pbs. 1) Product mix problems 2) Make vs. buy 3) Investment/Portfolio allocation pbs 4) Scheduling 5) Transportation/Assignment problems 6) Blending 7) Multi-period planning 8) Cutting stock problems
#4: Scheduling Personnel (or Other Resources) to Shifts • Outline of problem: Demand for services varies over time (time of day or day of week). You can have employees start at any time, but you have less control over when they stop. Typically they want to work in blocks of time of at least some minimum length and must be paid a bonus (OT) to work longer than the standard period. You could hire enough people at all times to meet the peak demand, but that would be wasteful. How can you find a more efficient schedule?
Personnel Scheduling Natural Language Description • Decisions: How many people should be assigned to each shift (or shift type) • (Must explicitly identify shifts!) • Objective: Minimize the cost of the assignment, which is the sum over all shifts of the number of people working that shift times the cost/person assigned to that shift • Constraints: One for every time period. Meet demand in that period (& nonneg)
Scheduling Example:Police Shift Assignment • Demand for police is defined for four hour blocks throughout a 24 hour day • (Typically would really look at 168 hour week and pay attention to # of consecutive days officers worked too.) • Officers can work 8 or 12 hour shifts • Police are paid double time for working beyond 8 hours, so 12 hour shift costs twice as much as an 8 hour shift
Algebraic Formulation of Police Scheduling Example • Decision Variables • Xi = officers starting 8 hour shift in period i • Yi = officers starting 12 hour shift in period i • Objective: Minimize Labor Cost • Assume base pay equal for all officers, and measure in terms of multiples of base pay for one shift • Min Z = X1 + 2 Y1 + X2 + 2 Y2 + ...
Algebraic Formulation (cont.) • Constraints X6 + X1 + Y5 + Y6 + Y1 >= 30 (Period 1) X1 + X2 + Y6 + Y1 + Y2 >= 12 (Period 2) X2 + X3 + Y1 + Y2 + Y3 >= 16 (Period 3) X3 + X4 + Y2 + Y3 + Y4 >= 20 (Period 4) X4 + X5 + Y3 + Y4 + Y5 >= 36 (Period 5) X5 + X6 + Y4 + Y5 + Y6 >= 34 (Period 6) Xi, Yi >= 0 for all i
Review of Common Types of LP Pbs. 1) Product mix problems 2) Make vs. buy 3) Investment/Portfolio allocation pbs 4) Scheduling 5) Transportation/Assignment problems 6) Blending 7) Multi-period planning 8) Cutting stock problems
#5: Transportation/Assignment Problems • Have various quantities of a commodity at multiple sources. Need to meet demand for that commodity at “sinks” (destinations). How much should you move that from each source to each sink in order to minimize the cost of meeting demand at each destination. • Decision variables • Xij = amount sent from source i to sink j • Cost parameters • cij = cost per unit of shipping from source i to sink j
Review of Common Types of LP Pbs. 1) Product mix problems 2) Make vs. buy 3) Investment/Portfolio allocation pbs 4) Scheduling 5) Transportation/Assignment problems 6) Blending 7) Multi-period planning 8) Cutting stock problems
#6: Blending Problems • Several ingredients (feedstocks) are mixed to create different final products. How much of each ingredient should go into each product in order to minimize production costs while satisfying quality constraints on the products? E.g, • oil refining • producing animal feed mixes • production of dairy products • allocation of coal to power plants
Blending Problems • Decision Variables • Xij =units of ingredient i used in product j • units could be pounds, tons, gallons, etc. • Objective • Minimize cost of producing required amounts of each product (typically driven by cost of ingredients)
Blending Problems:Constraint Formulation • Demand constraint example • Need at least 8,000 pounds of product 1 • X11 + X21 >= 8,000 • Quality constraint example • Ingredient 1 is 20% corn. Ingredient 2 is 50% corn. • Product 1 must be at least 30% corn. • 0.20 X11 + 0.50 X21 >= 0.30 (X11 + X21)
Review of Common Types of LP Pbs. 1) Product mix problems 2) Make vs. buy 3) Investment/Portfolio allocation pbs 4) Scheduling 5) Transportation/Assignment problems 6) Blending 7) Multi-period planning 8) Cutting stock problems
#7: Multi-period Planning Problems • These show up in many contexts, e.g. • investing (over time) • production planning (over time) • workforce planning (over time) • Key characteristics • decisions about multiple time periods • some quantity is “conserved” over time, creating constraints that span or link different time periods
#7a: Multi-period Financial Planning Problems • Invest money to maximize return, manage cash flow during construction project, etc. • Decision variables • Xij=amount invested in instrument i at time j • Typical objectives • Maximize value in last period or • Minimize amount needed in first period
Multi-period PlanningConstraints • “Mass balance” constraint on money for each time period Revenue at time t + $ maturing at time t = amount invested at time t + payments due at time t (for every period t) • Constraints on mix of investments • Do not exceed maximum risk threshold • Maintain minimum level of liquidity • Etc.
#7b: Multi-Period Planning:Trading Off OT and Inventory • Suppose that in some periods demand exceeds normal production capacity. Three (costly) possible responses: • Use over-time • Produce ahead and hold in inventory • Fail to meet demand fully • What balance of these strategies is best in each period?
Notation • Decision variables • Xi = regular production in period i • Yi = OT production in period i • Zi = shortage in period i • Ii = inventory carried into period i • Parameters • Di = demand in period i • I1 = initial inventory • Cost parameters
Formulation • Minimize weighted sum of X’s, Y’s, Z’s, and I’s • Subject to • Xi <= regular production capacity • Yi <= OT production capacity • Ii <= storage capacity • Ii + Xi + Yi + Zi = Di + Ii+1 mass balance constraint
#7c: Multi-Period Planning:Work Force Scheduling • Size of (trained) labor force required varies over time (e.g., IRS staff) • Can • Hire new employees, but they need to be trained by experienced workers (which takes time away from primary task) and may not stay with organization • (Sometimes) can lay-off employees • (Sometimes) can outsource or hire temps, but typically at a high cost • (or proactively balance the workload)
Notation • Decision variables • Wi = # of contractors hired in period i • Xi = # employees hired & trained in period i • Yi = # of experienced workers in period i • Zi = # layed off at beginning of period i • Parameters • Di = demand for exp. workers in period i • Y0 = initial number of experienced workers • Cost parameters
Formulation • Min weighted sum of W’s, X’s, Y’s, &Z’s • Suppose • One exp worker can train four new hires • 95% retention of experienced workers • 50% retention of trainees • Then constraints for each period i are • Wi+ Yi- 0.25 Xi >= Di • Yi + Zi = 0.95 Yi-1 + 0.5 Xi-1 mass balance • nonnegativity
Review of Common Types of LP Pbs. 1) Product mix problems 2) Make vs. buy 3) Investment/Portfolio allocation pbs 4) Scheduling 5) Transportation/Assignment problems 6) Blending 7) Multi-period planning 8) Cutting stock problems