IFSM 300 – Class 7 February 18, 2002 Preliminaries Collect homework 2. Class Web site reminder: http://www.gl.umbc.edu/~rrobinso/ Assignment 7: for today’s class read chapter 7. Next class: we will review answers to homework 2, and otherwise prepare for exam 1. Download the free Windows trial version of LINDO 6.1 from www.lindo.com. Their helps, which include an example, are good. Introduction to Linear Programming Recall that three broad categories encompass most OR methods – optimization, simulation, and pattern recognition. Linear programming is an optimization method, as is decision analysis. Plain vanilla LP is deterministic rather than probabilistic (also called stochastic). Thus LP presents less of a mental hurdle to the client than does a probabilistic method like decision analysis. In common with all optimization methods, LP combines a description of the situation under study (a simulation, essentially) with an optimization procedure that permits automatically searching among various action choices to find the best. In decision analysis, the number of possible actions considered typically is small. The key advantage of DA is that it offers a way to describe uncertainty and risk, and it enables the client to analyze a complicated sequence of choices, followed by uncertain events, followed by more choices, and so on. The key advantage of LP, on the other hand, is that it permits automatically searching among a huge number of action choices – a gigantic number – to locate the best. To gain this tremendous advantage, we must set up the analysis following LP groundrules, which are restrictive. Sometimes the situation seems to differ too much from the groundrules to permit using LP. Or, sometimes following the groundrules leads to set-ups too large to handle, even within the vast capacity of practical LP implemented in industrialstrength software. Before concluding that LP won’t fit, for either reason, experienced LP specialists can try various tricks-of-the-trade. While the method of linear programming certainly is one of OR’s killer methods, it also is a gift from the OR community to all branches of engineering, as well as to economics and the other branches of science. The many reflections of LP’s broad influence include that it was the subject of the 1975 Nobel Prize in economics, and, more recently, it is on the National Academy of Engineering’s list of twenty greatest engineering achievements of the 20th century. 1 The basic invention of LP was that of showing how to go about solving LP models in practical applications. The original solution method was called the simplex method. Note: The inventor of LP and the simplex method, George Dantzig, earned his undergraduate degree at the University of Maryland, where his father, Tobias Dantzig, served on the faculty. Introduction to Linear Models Complete notes below. Summary here. One independent variable, positive or negative slope. Variables and parameters. Example of fixed and variable cost. Example of the trouble with ratios. Generalization to multiple variables. Introduction to Linear Programming Models Complete notes below. Summary here. Review equation form of an LP: maximize (or minimize) a linear objective function of non-negative continuous decision variables, while satisfying conditions (which describe the details of the situation being modeled) expressed as a set of linear equations each of which contains parameters and nonnegative continuous variables on the left, a parameter on the right. These equations are called constraints. The situation is more likely to be described by inequalities than equalities. Ordinary inequality relationships ( or ) are readily accommodated by introducing slack and surplus variables. A strict inequality ( or ) is accommodated by also revising the constant on the right side by a small amount. Further, we can readily accommodate variables that aren’t always nonnegative. Millionaire Q1 A plain vanilla LP model is a: A. Stochastic simulation model. B. Stochastic optimization model. C. Deterministic simulation model. D. Deterministic optimization model. (!!) Millionaire Q2 The following expression is not linear: A. y = 10. B. y/x = 25. C. y = 4x2 + 8. (!!) D. y = 14 + 6x1 + 9x2 – 3. 2 Millionaire Q3 The decision variables in a plain vanilla LP must be: A. Non-negative and discrete. B. Positive and discrete. C. Non-negative and continuous. (!!) D. Positive and continuous. Millionaire Q4 Each constraint in an LP must NOT have: A. Variables on the left. B. Equal between left and right. C. One parameter on the right. D. Variables on the right. (!!) Millionaire Q5 In an LP constraint, to convert an actual inequality into a standard = equality we: A. Add a surplus variable. B. Subtract a surplus variable. C. Add a slack variable. (!!) D. Subtract a slack variable. Millionaire Q6 In an LP, to include a variable that may have both positive and negative values, we replace this variable with: A. The sum of two non-negative variables. B. The difference between two non-negative variables. (!!) C. The product of two non-negative variables. D. The ratio of two non-negative variables. Complete Notes On the pages that follow. 3 Notes: Introduction to Linear Models In lecture 3 we reviewed the idea of a mathematical model – widely used not only in OR but also in all of engineering and quantitative science. Now we consider a particular type of math model, the linear model, the easiest with which to work. We are headed toward study of the linear programming model, one breed of linear model. Function. Any math model consists of one or several functions. A function is just a procedure or “rule” that shows how to convert one or more inputs into one or more outputs. For example, suppose x represents an input, y an output, in the function y = 5 x. Then an input of x = 3 produces the output y = (5)(3) = 15. Or an input of x = -7 gives the output y = -35. And so on. The input which we can vary, and the output which varies as we vary the input, are called variables. The number 5 which does not vary (unless we revise its assigned value) is called a parameter(or coefficient or constant). In the vocabulary of mathematics, an input is termed an independent variable, an output a dependent variable. Of course the roles of independent and dependent variables are not, as they say, carved in marble. In this example we could rewrite the function as x = (1/5) y, and then let y be the input, x the output. Simple Linear Model. Suppose we have only one independent variable. Define: y – dependent variable x – independent variable m – a parameter called the slope ( = dy/dx from “calculus 101”) b -- a parameter called the y-intercept. The linear model is y = m x + b, (e.g., y = 5 x + 10, or y = - 3 x + 15), which applies with whatever values of x we stipulate. For instance, the applicable values of x might be all nonnegative x’s, written x 0. 4 This model is the famous equation of a straight line, shown in the following graph: If the slope m is positive, the line points upward to the right. If m is negative, the line points downward. The magnitude of m measures steepness – the larger the value of m, the steeper the line. Application 1: Fixed and Variable Cost. In practice, especially business practice, many, many non-OR analysts use the fixed-and-variable-cost method. This method, in its basic form, amounts to applying a linear model with one independent variable. For instance, suppose x is the number of units produced (over a designated time period) in a manufacturing plant. An FAVC model would be: 5 where we define: y – total cost ($) dependent variable x – units produced (number of units) independent variable b – fixed cost ($) parameter m – variable cost per unit ($ per unit) parameter. Often, the way the non-OR analysts estimate b and m is to list the different components whose costs make up total cost and then classify each component as either fixed or variable. Then they add all the component costs designed “fixed” to estimate b, and all the component costs designated “variable” to estimate b. With little or no historical experience, this is reasonable. But the accuracy may be shaky because the component costs rarely are purely fixed or purely variable If, however, historical data on total cost, observed under circumstances that still prevail, is available, as it is frequently, you may be able to improve accuracy. You would record total cost y and corresponding number of units x in various different time periods (each observation, a y-x pair from a particular time period, is a point on a y-versus-x graph) and then fit a line to the observed points. This permits the data to show us directly how much of the total cost is fixed and how much is variable. Application 2: The Ratio Method. Many non-OR analysts obtain one quantity in a spreadsheet from another quantity by calculating their ratio from historical data and assuming the ratio stays the same. For example, recent history may indicate that cost/sales = 0.85. In a forecast for next period, with sales projected to be $500 million, they calculate projected cost to be (0.85)(500) = $425 million. Let x be the input (sales), y the calculated output (cost), and r the ratio. Then r = y/x, or, in other words, y = r x. This is a one-independent-variable linear model from which the y-intercept b has been omitted (set equal to 0). On a graph, it appears as a straight line through the origin (0,0). Any math model has limitations. For instance, a relationship observed in the past may change – a well-known modeling pitfall called “structural change.” The ratio model, however, has its own additional limitation. To see the limitation of the ratio model, let’s examine a curve that represents a typical accurate relationship between cost of production y and quantity produced x: a curve shaped like an S rather than a straight line: 6 The ratio model fits well only for values of x (quantity produced) close to the value that prevailed at the time of the history from which the ratio was determined. The general linear model, on the other hand, fits reasonably well over a much broader range of x values. Its accuracy deteriorates mostly at the beginning of the x range (start-up or shutdown stage) and at the end of the x range (pushing the upper limits of capacity). General linear model. To generalize the one-input linear model, we add more inputs: y = m1 x1 + m2 x2 + … + mn xn + b. Any of the signs could be – instead of +, corresponding to a negative m or negative b. Should we have more than one constant, we can add them together (b1 + b2 + …) to form the single constant term b. Notes: Introduction to Linear Programming Models Equation Form. The equation form of a basic (plain vanilla) linear programming (LP) model is: MAXIMIZE or MINIMIZE a linear objective function of nonnegative continuous decision variables 7 subject to linear constraint equations, each with nonnegative continuous decision variables and their coefficients on the left, one parameter on the right. Example: MAX 2 x1 + 3 x2 subject to 2 x1 + x3 = 2 x2 + x4 = 1 (x1, x2, x3, x4 0). Observe that not all decision variables need appear in both the objective function and the constraints. Be aware also that in the event the original objective function contains a constant term b, you may omit b when solving the LP and then, as a final step, add b back to the optimal objective-function value. To Increase Model Flexibility. The equation form of LP seems, and is, extremely restrictive. By means of various tricks of the trade, however, we can readily make it more flexible. For instance, the constraints in the application being modeled are more likely to be described by inequalities than equalities. To handle this, we introduce slack and surplus variables: Less-than-or-equal-to inequality: Add a nonnegative slack variable s. Example: actual constraint 5 x1 + 2 x2 10 equation form 5 x1 + 2 x2 + s1 = 10 Interpretation of s1: the unused (slack) amount still available – after the quantity described by the constraint (5 x1 + 2 x2) has been recognized – before the constraint quantity would increase to the upper limit (10). Greater-than-or-equal-to inequality: Subtract a nonnegative surplus variable s. 8 Example: actual constraint 4 x1 + 7 x2 5 equation form 4 x1 + 7 x2 – s2 = 5 Interpretation of s2 – the additional (surplus) amount still available – after the quantity described by the constraint (4 x1 + 7 x2) has been recognized – before the constraint quantity would decrease to the lower limit (5). Strict inequality: or Vary the right-side parameter slightly. Example 1: actual constraint 5 x1 + 2 x2 10 equation form 5 x1 + 2 x2 + s1 = 9.99 Example 2: actual constraint 4 x1 + 7 x 2 5 equation form 4 x1 + 7 x2 – s2 = 5.01 To further illustrate techniques that offer greater flexibility in modeling, let’s see how we might accommodate decision variables that are not always nonnegative: Negative variable Suppose (for instance) x3 is negative or zero. Define a new nonnegative variable x4 (for instance) by x3 = - x4. Substitute - x4 for x3 in the LP model, solve the LP to find x4*, and then calculate x3* = - x4*. Example: (1) Convert x3 wherever it appears in the model. For example, 3 x3 would be converted to – 3 x4. (2) Solve the LP. It produces (say) x4* = 15. (3) Calculate x3* = - x4* = - 15. Variable both positive and negative Suppose (for instance) x5 is both positive and negative. Define two new nonnegative variables x6 and x7 (for instance) by x5 = x6 – x7. Substitute x6 – x7 for x5 in the LP model, solve the LP to find x6* and x7*, and then calculate x5* = x6* - x7*. Example: (1) Convert x5 wherever it appears in the model. For example, 10 x5 would be converted to 10 x6 – 10 x7. (2) Solve the LP. (i) It produces (say) x6* = 27, x7* = 2. (ii) Or (say) it 9 produces x6* = 1, x7* = 11. (3) Calculate (ii) x5* = x6* - x7* = 27 – 2 = 25, or (ii) x5* = 1 – 11 = - 10. Further Comments on LP in Practice. The art of building LP models is the art of describing an application well while living within a restrictive framework, such as that just reviewed. The LP model builder does this by employing a bag of tricks. You have now seen a few. Many other tricks (“ piecewise linear approximation,” just to cite one example) are there to help better match the model to the application. Once the model builder succeeds in developing a good model, attention focuses on solving it. Occasionally, with applications that are especially large (have a large number of constraints and decision variables), the straightforward use of commercial solution engines bogs down. For instance, the solution may take longer than the time the client is willing to wait. Another bag of tricks addresses such solution problems. For instance, choosing different LP software, or developing special solution procedures that take advantage of the model’s particular structure, may remove the difficulty. 10
© Copyright 2026 Paperzz