Introduction to OR OR6205 –Sep13, 2023 Application of Analytics ● Descriptive analytics (analyzing data to create informative descriptions of what has happened in the past or is happening in the present). ● Predictive analytics (using models to create predictions of what is likely to happen in the future). ● Prescriptive analytics (using decision models, including optimization models, to create and/or advise managerial decision making). Applying Prescriptive Analytics Basic Steps for Applying Prescriptive Analytics 1. Formulating a mathematical model to begin applying prescriptive analytics 2. Learning how to derive solutions from the model 3. Testing the model 4. Preparing to apply the model 5. Implementation Mathematical Models ● Mathematical model of a business problem is the system of equations and related mathematical expressions that describe the essence of the problem. ● There are n related quantifiable decisions to be made, they are represented as decision variables ( 𝑥1 , 𝑥2 , . . . , 𝑥𝑛 ) whose respective values are to be determined. ● Objective Function: measure of performance (e.g., profit) is expressed as a mathematical function of decision variables ● ● (Z = 3 𝑥1 + 2 𝑥2 + . . . + 5 𝑥𝑛 ) Constraints: any restrictions on the values that can be assigned to these decision variables are also expressed mathematically, typically by means of inequalities or equations (4 𝑥1 + 5 𝑥2 ≤ 10) The constants (namely, the coefficients and right-hand sides) in the constraints and the objective function are called the parameters of the model. Graphical LP Solution WYNDOR GLASS CO - Prototype Example ● The WYNDOR GLASS CO. produces high-quality glass products, including windows and glass doors. It has three plants. Aluminum frames and hardware are made in Plant 1, wood frames are made in Plant 2, and Plant 3 produces the glass and assembles the products. ● Because of declining earnings, top management has decided to revamp the company’s product line. Unprofitable products are being discontinued, releasing production capacity to launch two new products having large sales potential: ● ● Product 1: An 8-foot glass door with aluminum framing Product 2: A 4 × 6 foot double-hung wood-framed window ● Product 1 requires some of the production capacity in Plants 1 and 3, but none in Plant 2. Product 2 needs only Plants 2 and 3. The marketing division has concluded that the company could sell as much of either product as could be produced by these plants. However, because both products would be competing for the same production capacity in Plant 3, it is not clear which mix of the two products would be most profitable. Therefore, an OR team has been formed to study this question. Discussions with Upper Management to Identify Management’s Objectives for the Study ● Determine what the production rates should be for the two products in order to maximize their total profit, subject to the restrictions imposed by the limited production capacities available in the three plants. (Each product will be produced in batches of 20, so the production rate is defined as the number of batches produced per week.) ● Because the work on the current batch of a particular product commonly is only partially completed at the end of a given week, the production rate can be either an integer or noninteger number. Any combination of production rates that satisfies the restrictions imposed by the limited production capacities is permitted, including producing none of one product and as much as possible of the other. The OR team also Identified the Data that Needed to be Gathered: 1. 2. 3. Number of hours of production time available per week in each plant for these new products. (Most of the time in these plants already is committed to current products, so the available capacity for the new products is quite limited.) Number of hours of production time used in each plant for each batch produced of each new product. Profit per batch produced of each new product. (Profit per batch produced was chosen as an appropriate measure after the team concluded that the incremental profit from each additional batch produced would be roughly constant regardless of the total number of batches produced. Because no substantial costs will be incurred to initiate the production and marketing of these new products, the total profit from each one is approximately this profit per batch produced times the number of batches produced .) WYNDOR GLASS CO Example This problem is a classic example of a resource-allocation problem, the most common type of linear programming problem. Graphical Solution Graphical Solution Graphical Method ● Three lines just constructed are parallel. The Reddy Mikks Company – Example Optimum solution of the Reddy Mikks model Standard Form of the Model Common Terminology for Linear Programming ● The key terms are resources and activities, where m denotes the number of different kinds of resources that can be used and n denotes the number of activities being considered. Some typical resources are money and particular kinds of machines, equipment, vehicles, and personnel. Examples of activities include investing in particular projects, advertising in particular media, shipping goods from a particular source to a particular destination, and so forth. Data for Allocation of Resources to Activities A Standard Form of the Model Objective Function Constraints Nonnegativity Constraints Terminology for Solutions of the Model Terminology for Solutions of the Model ● A feasible solution is a solution for which all the constraints are satisfied. ● An infeasible solution is a solution for which at least one constraint is violated. no feasible solutions Optimal Solution ● Given that there are feasible solutions, the goal of linear programming is to find a best feasible solution, as measured by the value of the objective function in the model. ● An optimal solution is a feasible solution that has the most favorable value of the objective function. ● The most favorable value is the largest value if the objective function is to be maximized, whereas it is the smallest value if the objective function is to be minimized. ● ● Most problems will have just one optimal solution. However, it is possible to have more than one. Any problem having multiple optimal solutions will have an infinite number of them, each with the same optimal value of the objective function. Example of Multiple Optimal Solutions objective function were changed to Z = 3x1 + 2x2 No Optimal Solutions ● Another possibility is that a problem has no optimal solutions . ● No optimal solutions occurs only if: 1. 2. ● it has no feasible solutions the constraints do not prevent improving the value of the objective function (Z) indefinitely in the favorable direction (positive or negative). The latter case is referred to as having an unbounded Z or an unbounded objective. Example of No Optimal Solutions This problem would have no optimal solutions if the only functional constraint were x1 ≤ 4, because x2 then could be increased indefinitely in the feasible region without ever reaching the maximum value of Z = 3x1 + 5x2. A Corner-point Feasible (CPF) Solution ● A corner-point feasible (CPF) solution is a solution that lies at a corner of the feasible region. ● CPF solutions are commonly referred to as extreme points (or vertices) by OR professionals, but we prefer the more suggestive corner-point terminology in an introductory course. CPF plays the key role when the simplex method searches for an optimal solution. Relationship between Optimal Solutions and CPF Solutions ● Consider any linear programming problem with feasible solutions and a bounded feasible region. ○ ○ ○ The problem must possess CPF solutions and at least one optimal solution. Furthermore, the best CPF solution must be an optimal solution. Thus, if a problem has exactly one optimal solution, it must be a CPF solution. If the problem has multiple optimal solutions, at least two must be CPF solutions. Linear Inequality Assumptions of Linear Programming From, a mathematical viewpoint, the assumptions simply are that the model must have a linear objective function subject to linear constraints. However, from a modeling viewpoint, these mathematical properties of a linear programming model imply that certain assumptions must hold about the activities and data of the problem being modeled. 1. Proportionality : Contribution of a variable is proportional to its value 2. Additivity: Contribution of variables are independent 3. Divisibility: Decision variables can take fractional values 4. Certainty: Each parameter is known with certainty Proportionality ● Proportionality is an assumption about both the objective function and the functional constraints ● Contribution of a variable is proportional to its value Additivity ● Proportionality is an assumption about both the objective function and the functional constraints ● Contribution of variables is independent Additivity assumption: Every function in a linear programming model (whether the objective function or the function on the left-hand side of a functional constraint) is the sum of the individual contributions of the respective activities. Divisibility ● Concerns the values allowed for the decision variables ● Decision variables can take fractional values Divisibility assumption: Decision variables in a linear programming model are allowed to have any values, including noninteger values, that satisfy the functional and nonnegativity constraints. Thus, these variables are not restricted to just integer values. Since each decision variable represents the level of some activity, it is being assumed that the activities can be run at fractional levels. Certainty ● Concerns the parameters of the model, namely, the coefficients in the objective function cj, the coefficients in the functional constraints aij, and the right-hand sides of the functional constraints bi. ● Each parameter is known with certainty Certainty assumption: The value assigned to each parameter of a linear programming model is assumed to be a known constant. Additional Example – Investment Additional Example – Investment ● Multitudes of investment opportunities are available to today’s investor. ● Examples of investment problems are capital budgeting for projects, bond investment strategy, stock portfolio selection, and establishment of bank loan policy. ● Using LP to maximize the return Example – Bank Loan Model ● Bank One is in the process of devising a loan policy that involves a maximum of $12 million. The following table provides the pertinent data for available loans. Bad debts are unrecoverable and produce no interest revenue. Competition with other financial institutions dictates the allocation of at least 40% of the funds to farm and commercial loans. To assist the housing industry in the area, home loans equals at least 50% of personal, car, and home loans combined. The bank limits the overall ratio of bad debts on all loans to at most 4%. Solution- Mathematical Model • The objective of the Bank One is to maximize net return • The difference between interest revenue and lost bad debts. • Interest revenue is accrued on loans in good standing. For example, when 10% of personal loans are lost to bad debt, the bank receives interest on 90% of the loan—that is, 14% interest on .9 x1 of the original loan x1 Solution- Mathematical Model 1. Total fund not exceed $12 (million) 2. Farm and commercial loans equal at least 40% of all loans: Solution- Mathematical Model 3. Home loans should equal at least 50% of combined personal, car, and home loans: 4. Bad debts do not exceed 4% of all loans: 5. Nonnegativity: Additional Example – Bus Scheduling Model Example - Bus Scheduling Model ● The bus transportation system in Progress City operates under the three traditional 8-hour shifts, starting daily at 8:00 a.m., 4:00 p.m., and midnight (12:01 a.m.). ● The city is studying the feasibility of revamping its bus schedule with the goal of reducing carbon footprint. ● The study seeks the minimum number of buses that can handle public transportation needs. ● Gathered data shows that the minimum number of buses needed to meet the transportation demand can be approximated over successive 4-hour intervals. Solution- Mathematical Model Solution- Mathematical Model Excel Solution Excel Solution LP Transformation Techniques Ads Example ● The goal is to minimize the cost of reaching 1.5 million people using ads of different types. Introduce a non-linear constraint ● We are now going to introduce a non-linear constraint. Suppose that we require that the total of ads from the electronic media is within 5 of the number of ads of paper-based media. This can be modeled as follows: |x1 + x2 – x3 – x4 | ≤ 5 Transformation Techniques ● The constraint “|x1 + x2 – x3 – x4 | ≤ 5” is not a linear constraint. However, the constraint can be transformed into linear constraints using a simple trick/ “technique”. ● The constraint “|x1 + x2 – x3 – x4 | ≤ 5” is equivalent to the following two constraints: 1. 2. x1 + x2 – x3 – x4 ≤ 5 -x1 - x2 + x3 + x4 ≤ 5 The feasible regions are exactly the same Can we always use the trick to transform problems involving absolute values to a linear program? ● Unfortunately, we can’t. Consider the case in which we want the number of radio and TV ads to differ by at least 2. This corresponds to the constraint “|x1 – x2 | ≥ 2.” This is equivalent to “x1 – x2 ≥ 2 OR –x1 + x2 ≥ 2”. But it cannot be made linear. The feasible region is in yellow. It’s in two separate pieces. But a linear programming feasible region is always connected. In fact, it’s always convex. That is, if two points are feasible, then so is the line segment joining the two points. A Minimax Objective Functions , , Transforming a Minimax Objective ● The minimax objective can be transformed by including an additional decision variable z, which represents the maximum costs: ● In order to establish this relationship, the following extra constraints must be imposed: The Equivalent Linear Program Simplex Method Solving Linear Programming Problems: The Simplex Method ● ● ● ● Simplex method: a general procedure for solving linear programming problems. Developed by the brilliant George Dantzig in 1947 It has proved to be a remarkably efficient method that is used routinely to solve huge problems on today’s computers. The simplex method is an algebraic procedure. However, its underlying concepts are geometric. The Essence of the SIMPLEX Method Constraint boundary: is a line that forms the boundary of what is permitted by the corresponding constraint. The points of intersection are the corner-point solutions of the problem. The five that lie on the corners of the feasible region—(0, 0), (0, 6), (2, 6), (4, 3), and (4, 0)—are the corner-point feasible solutions (CPF solutions). The other three—(0, 9), (4, 6), and (6, 0)—are called corner-point infeasible solutions. The Essence of the SIMPLEX Method Each corner-point solution lies at the intersection of two constraint boundaries. For a linear programming problem with n decision variables, each of corner-point solutions lies at the intersection of n constraint boundaries. Certain pairs of the CPF solutions share a constraint boundary, and other pairs do not. For any linear programming problem with n decision variables, two CPF solutions are adjacent to each other if they share n − 1 constraint boundaries. The two adjacent CPF solutions are connected by a line segment that lies on these same shared constraint boundaries. Such a line segment is referred to as an edge of the feasible region. Since n = 2 in the example, two of its CPF solutions are adjacent if they share one constraint boundary; for example, (0, 0) and (0, 6) are adjacent because they share the x1 = 0 constraint boundary. One Reason for our Interest in Adjacent CPF ● Optimality test: Consider any linear programming problem that possesses at least one optimal solution. If a CPF solution has no adjacent CPF solutions that are better (as measured by Z), then it must be an optimal solution. Thus, for the example, (2, 6) must be optimal simply because its Z = 36 is larger than Z = 30 for (0, 6) and Z = 27 for (4, 3). This optimality test is the one used by the simplex method for determining when an optimal solution has been reached. Simplex Method Example- Geometric Viewpoint ● Initialization: Choose (0, 0) as the initial CPF solution to examine. (This is a convenient choice because no calculations are required to identify this CPF solution.) ● Optimality Test: Conclude that (0, 0) is not an optimal solution. (Adjacent CPF solutions are better.) ● Iteration 1: Move to a better adjacent CPF solution, (0, 6), by performing the following three steps. 1. Considering the two edges of the feasible region that emanate from (0, 0), choose to move along the edge that leads up the x2 axis. 2. Stop at the first new constraint boundary: 2 x2 = 12 3. Solve for the intersection of the new set of constraint boundaries: (0, 6). Simplex Method Example- Geometric Viewpoint Optimality Test: Conclude that (0, 6) is not an optimal solution. (An adjacent CPF solution is better.) ● 1. Iteration 2: Move to a better adjacent CPF solution, (2, 6), by performing the following three steps: Considering the two edges of the feasible region that emanate from (0, 6), choose to move along the edge that leads to the right. 2. Stop at the first new constraint boundary encountered when moving in that direction: 3 x1 + 2 x2 = 18. (Moving farther in the direction selected in step 1 leaves the feasible region.) 3. Solve for the intersection of the new set of constraint boundaries: (2, 6). (The equations for these constraint boundaries, 3 x1 + 2 x2 = 18 and 2 x2 = 12, immediately yield this solution.) Optimality Test: Conclude that (2, 6) is an optimal solution, so stop. (None of the adjacent CPF solutions are better.)