chapter 6 optimization models with integer variables

33
Chapter 6 Optimization Models with Integer Variables

Upload: sabrina-watson

Post on 27-Dec-2015

266 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 6 Optimization Models with Integer Variables

Chapter 6Optimization Models with Integer Variables

Page 2: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Introduction

• In this chapter, we show how many complex problems can be modeled using 0–1 variables and other variables that are constrained to have integer values.

• A 0–1 variable is a decision variable that must equal 0 or 1. Usually a 0–1 variable corresponds to an activity that either is or is not undertaken.

• If the 0–1 variable corresponding to the activity equals 1, the activity is undertaken; if it equals 0, the activity is not undertaken. A 0–1 variable is also called a binary variable.

Page 3: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Introduction continued

• Optimization models in which some or all of the variables must be integers are known as integer programming (IP) models.

• In this chapter, we illustrate many of the modeling techniques that are needed to formulate IP models of complex situations.

• You should be aware that any optimization software, including Excel’s Solver, typically has a much harder time solving an IP problem than an LP problem.

Page 4: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Overview of optimization with integer variables

• When Excel’s Solver solves a linear model without integer constraints, it uses a very efficient algorithm, the simplex method, to perform the optimization.– The simplex method is efficient because it typically

examines only a very small fraction of the hundreds, thousands, or even millions of possible corner points before determining the best corner point.

• The main difference between LP and IP models is that LP models allow fractional values, such as 0.137 and 5.3246, in the changing cells, whereas IP models allow only integer values in integer-constrained changing cells.

Page 5: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Overview of optimization with integer variables continued

• Although several solution methods have been suggested by researchers - and new methods for specialized problems are still being developed - the solution procedure used by Solver is called branch and bound.

Page 6: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Branch and bound algorithm

• Consider a model with 100 changing cells, all constrained to be binary. Because there are only two values for each binary variable - 0 and 1 - there are potentially 2100 feasible solutions, although many of these might not satisfy all of the constraints.

• Unfortunately, 2100 is an extremely large number, so it would take even a very fast computer a long time to check each one of them. Therefore, the naive method of complete enumeration of all possible solutions - look at each solution and select the best - is usually impractical.

Page 7: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Branch and bound algorithm continued

• However, implicit enumeration is often very practical. This approach examines only a fraction of all 2100 potential solutions and guarantees that solutions not examined have no chance of being optimal.

• A general idea is the essence of the branch and bound method used by Solver in IP models. – The branching part means that the algorithm

systematically searches through the set of all feasible integer solutions, creating branches, or subsets, of solutions as it goes.

Page 8: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Branch and bound algorithm continued

– The key, however, is the bounding part of the algorithm. Every time the best feasible solution is found, it is called the incumbent solution – the best so far. It is the easy part of the bounding procedure, and the solution represents a lower bound on the optimal solution (for a maximize objective).

– The upper bound is more difficult to find, and the procedures used to find upper bounds are beyond the level of this book.

Page 9: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Solver Tolerance setting

• The Solver Options dialog box contains a Tolerance setting, which is relevant for integer-constrained models.

• Excel’s default tolerance is 5%. In Excel 2010, this setting, listed as Integer Optimality (%), is found under Solver Options in the dialog box shown here.

Page 10: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Solver Tolerance setting continued

• To explain the Tolerance option, we must first define the LP relaxation of an IP model.

• This is the same model as the IP model, except that all integer constraints are omitted. – In particular, cells that are originally constrained to be

binary are allowed under the LP relaxation to have any fractional values between 0 and 1 (including 0 and 1).

• The LP relaxation is typically easy to solve (using the simplex method), and it provides a bound for the IP model.

Page 11: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Solver Tolerance setting continued

• A tolerance setting of 5% means that Solver stops as soon as it finds a feasible (integer) solution to the IP model that is within 5% of the current upper bound.

• Initially, the optimal objective value of the LP relaxation serves as the upper bound. As Solver proceeds to find solutions that satisfy the integer constraints, it keeps updating the upper bound.

• The important point is that when Solver stops, it guarantees an integer solution that is within at least 5% of the optimal integer solution.

Page 12: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Solver Tolerance setting continued

• The implication is that if you set the tolerance to 0%, Solver will (in theory) run until it finds the optimal integer solution. So why isn’t a tolerance setting of 0% always used?

• The reason is that for many IP models, especially large models, it can take Solver a long time to find the optimal solution (or guarantee that the best solution found so far is optimal).

• On the other hand, a solution that is close to optimal - within 5%, say - can often be found quickly.

Page 13: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Solver messages

• When you run Solver on some of the difficult problems in this chapter, you might get different messages, shown below.

• You have two options:1. Change the options in Solver settings

2. Click on Continue to let Solver run longer. We recommend the second option.

Page 14: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Capital budgeting models

• Perhaps the simplest binary IP model is the following capital budgeting example, which illustrates the go/no-go nature of many IP models.

• Example 6.1 demonstrates a typical capital budgeting model.

Page 15: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Fixed-cost models• In many situations, a cost is incurred if an activity is

undertaken at any positive level. This cost is independent of the level of the activity and is known as a fixed cost (or fixed charge).

• Here are three examples of fixed costs:– The construction of a warehouse incurs a fixed cost that is

the same whether the warehouse is built with a low- or a high-capacity level.

– A cash withdrawal from a bank incurs a fixed cost, independent of the size of the withdrawal.

– A machine that is used to produce several products must be set up for the production of each product. Regardless of the batch size produced, the same fixed cost (lost production due to the setup time) is incurred.

Page 16: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Fixed-cost models continued

• In these examples, a fixed cost is incurred if an activity is undertaken at any positive level, whereas no fixed cost is incurred if the activity is not undertaken at all.

• Although it might not be obvious, this feature makes the problem inherently nonlinear, which means that a straightforward application of LP is not possible.

• However, a clever use of 0–1 variables can result in a model with linear constraints and a linear objective.

Page 17: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Fixed-cost models continued• It is important to realize that you do not simply create

an LP model and then add integer constraints.• Instead, you use 0-1 variable to model the logic. • The logic in this section is that if a certain activity is

done on any positive level, a fixed cost is incurred.• No fixed cost is incurred if the activity is not done at all.• Solver is able to handle linear models with binary

variables, so this is the approach you should take whenever possible.

• Example 6.2 is used to demonstrate this type of model.

Page 18: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

A model with IF functions• In case you are still not convinced that the binary

variable approach is required, and you think IF functions could be used instead, take a look at the finished version of the file.

• The resulting model looks the same, but it incorporates the following changes:– We no longer use the binary range as part of the changing

cells range. Instead, we enter the formula =IF(B16>0,1,0) in cell B14 and copy it across to cell F14.

– We model the effective capacities in row 18 with IF functions. Specifically, we enter the formula =IF(B16>0,MIN($D$22/B5,$D$23/B6),0) in cell B18 and copy it across to cell F18.

Page 19: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

A model with IF functions continued

– We change the Solver dialog box so that it appears as shown below. The Rent_equipment range is not part of the changing cells range, and there is no binary constraint.

Page 20: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

A model with IF functions continued

• When we ran Solver on this modified model, we found inconsistent results, depending on the initial production quantities entered in row 16.

• However, when we entered initial production quantities all equal to 100, Solver found the correct optimal solution.

• The moral is that the IF-function approach is not the way to go. Its success depends strongly on the initial values we enter in the changing cells, and this requires us to make very good guesses. The binary approach ensures that we get the correct solution.

Page 21: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Either-or constraints• The following example is similar to the Great Threads

example in that there is a fixed cost for any positive level of production of a given product.

• However, an additional requirement states that if the company produces any of a given product, then (possibly because of economies of scale) it must produce at least some minimal level such as 1000.

• This is a typical example of a problem with either-or constraints: The company’s level of production must either be 0 or at least 1000.

• In the next example, we show how the use of binary variables allows you to model the either-or constraints in a linear manner.

Page 22: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Set-covering and location-assignment models

• Many companies have geographically dispersed customers that they must service in some way.

• To do this, they create service center facilities at selected locations and then assign each customer to one of the service centers.

• Various costs are incurred, including: – Fixed costs of locating service centers in particular

locations; – Operating costs, depending on the service centers’

locations; and – Transportation costs, depending on the distances

between customers and their assigned service centers.

Page 23: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Set-covering and location-assignment models continued

• We first examine a particular type of location model called a set-covering model.

• In a set-covering model, each member of a given set (set 1) must be “covered” by an acceptable member of another set (set 2).

• The usual objective in a set-covering problem is to minimize the number of members in set 2 that are needed to cover all the members in set 1.

• Set-covering models have been applied to areas as diverse as airline crew scheduling, truck dispatching, political redistricting, and capital investment. Example 6.4 presents a typical set-covering model.

Page 24: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Assignment models

• Example 6.5 is similar to a set-covering model, but it also has an assignment model.

Page 25: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Cutting stock models

• The final model we discuss in this chapter has found many real-world applications, especially in manufacturing.

• The model is relevant in situations where a product is produced in a standard size, which must then be cut into one of several patterns to satisfy customer orders.

• In contrast to the other models in this chapter, this cutting stock model does not have binary variables, but it does have integer variables. The problem is relatively easy to model, but it can be very time-consuming for Solver to solve.

• IP models are inherently more difficult to solve than general LP problems.

• The model in example 6.7 illustrates that this is definitely the case.

Page 26: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Solver Tolerance setting

• Until now, we have suggested setting the Solver tolerance to 0%.

• This guarantees the optimal solution. However, this example illustrates why the default tolerance setting is 5%.

• When we set the tolerance to 0% and click on Solve, the Solver quickly got to a solution that requires 47 rolls, but then ran and ran and ran.

• After some experimenting, we found that with the tolerance set at 2% or above, the solution was obtained almost instantaneously, but with the tolerance set at 1% or 0%, it ran seemingly forever.

Page 27: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Solver Tolerance setting continued

• This behavior is not at all uncommon in IP models. • The Solver often finds a very good or even optimal

solution very quickly, but it takes a long time to verify that it is optimal.

• The moral is clear.• If you set the tolerance to a low value and find that

the Solver is taking forever without getting anywhere, press Ctrl-Break to get out. By that time, you probably already have a very good or even optimal solution.

Page 28: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Conclusion

• Three important points emerge from this chapter.

1. A wide variety of important problems can be modeled as IP problems with binary variables. These can generally be identified as problems where at least some of the activities (such as making a particular investment, opening a particular plant, or supplying a customer from a particular plant) must be done or not done; there is no in-between.

– Regular LP models cannot handle these problems; IP models with binary variables often can.

Page 29: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Conclusion continued

2. Some IP models are simply LP models with integer constraints on the variables.

– These problems can often be solved by solving the associated LP model and then rounding the solution to integer values.

– Although there is no guarantee that the rounded solution is optimal, it is often close enough.

– In contrast, most of the problems discussed in this chapter introduce binary decision variables that specify whether an activity is done or not. If you ignore the binary constraints and only constrain these variables to be between 0 and 1, it is generally impossible to find the optimal solution by rounding.

Page 30: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Conclusion continued

• The solution approach required for IP problems, especially those with 0-1 variables, is inherently more difficult than the simplex method for LP problems.

• Analysts typically employ heuristic methods on these really difficult problems.

Page 31: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Summary of key management science terms

Page 32: Chapter 6 Optimization Models with Integer Variables

Thomson/South-Western 2007 ©South-Western/Cengage Learning © 2012Practical Management Science, 4eWinston/Albright

Summary of key Excel terms

Page 33: Chapter 6 Optimization Models with Integer Variables

End of Chapter 6