• Nenhum resultado encontrado

ch06

N/A
N/A
Protected

Academic year: 2021

Share "ch06"

Copied!
63
0
0

Texto

(1)

DECISION MODELING WITH

DECISION MODELING WITH

MICROSOFT EXCEL

MICROSOFT EXCEL

Copyright 2001 Prentice Hall

Integer

Integer

Optimization

Optimization

Chapter 6 Chapter 6

(2)

Integer Linear Programming

Integer Linear Programming (ILP) models

are LP models in which some or all of the variables are required to assume integer values.

ILP has become an important specialized area of optimization modeling.optimization modeling

In previous chapters, noninteger solutions were allowed and often adapted to the

integer requirement by rounding (called a

rounded solution). However, a number of

important models require integer solutions.

Introduction

(3)

Integer Programming

Integer Programming is a general term for

optimization models with integrality integrality conditions

conditions.

The different types of ILP models are described next.

Types of Integer

Types of Integer

Optimization Models

Optimization Models

Integrality conditions stipulate that some or all of the decision variables must have

(4)

Classifications of

Classifications of

Integer Optimization Models

Integer Optimization Models

All-integer linear program

All-integer linear program

This is a model in which all of the all

decision variables are required to be integers.

Mixed integer linear program (MILP)

Mixed integer linear program (MILP)

This is a model in which only some of only some the decision variables are required to be integers and others can assume any nonnegative number (i.e., any any

continuous value

(5)

In this model, integer variables are restricted to the values 0 or 0 1. The 1 models may be used to represent dichotomous decisions (yes/no

decisions).

Binary (or 0-1) integer linear program

Binary (or 0-1) integer linear program

This LP model results when you start

with an ILP formulation but then ignore the integer restrictions.

LP relaxation of the ILP model

(6)

Graphical Interpretation

Graphical Interpretation

Of Integer Models

Of Integer Models

In this two variable ILP product mix model, let E and F represent the quantities of two products to make and sell for a profit.

Optimizing a Two Variable ILP Model

Optimizing a Two Variable ILP Model

Now, assume the < constraints represent resource restrictions and > represents

(7)

s.t. E – 3F < 0 (1) 42.8E + 100F < 800 (2) 20E + 6F < 142 (3) 30E + 10F > 135 (4) E, F > 0 and integer Max 18E + 6F

(8)

We will solve this model using the graphical approach following these three steps:

1. Find the feasible set for the LP relaxation of the ILP model.

2. Identify the integer points inside the set determined in step 1.

3. Find, among those points determined in step 2, one that optimizes the

objective function.

We will use the GLP program (covered in

Chapter 4) and Excel’s Solver to obtain the solution to the LP relaxation of the ILP.

(9)

Here are the GLP results: The shaded region is the feasible set for the LP relaxation. The blue dots are the integer points contained within the LP feasible region. These 13 integer points are

the set of feasible solutions to the ILP. (3,6) (4,6) (3,5) (4,5) (5,5) (4,4) (5,4) (4,2) (5,2) (6,2) (4,3) (5,3) (6,3)

(10)
(11)

To optimize the model, determine which of the ILP feasible points yields the largest value of the objective function.

To do this, drag the

objective function line in an uphill direction until it

is not possible to move it farther and still intersect an integer feasible point.

The optimal

solution is E=6 and F=3 for a max. profit of $126.

(12)

Here are the Solver results and parameters:

In order to specify the integer constraint, use the int option in the Add Constraint dialog.

Change %

Tolerance

setting to “0”

(13)

Nearest rounded solution (5,6) Optimal solution to LP relaxation (5.39,5.69) Only feasible rounded integer solution (5,5) Optimal solution to ILP (6,3)

(14)

1. In a Max model the OV (optimal Max

value) of the LP relaxation always

provides an upper bound on the OV ofupper bound the original ILP. Adding the integer

constraints either hurts or leaves

unchanged the OV for the LP. In a Max model, hurting the OV means making it smaller.

Comments

Comments

Graphical Interpretation

Graphical Interpretation

Of Integer Models

Of Integer Models

(15)

2. In a Min model, the OV of the LP Min relaxation always provides a lowerlower

bound

bound on the OV of the original ILP.

Again, adding the integer constraints either hurts or leaves unchanged the OV for the LP. In a Min model, hurting the OV means making it larger.

(16)

Graphical Interpretation

Graphical Interpretation

Of Integer Models

Of Integer Models

The optimal solution to the LP relaxation is E*=5.39 and F*=5.69.

Rounded Solutions

Rounded Solutions

Since each of these variables can be

rounded either up or down, there are four (22) rounded solutions:

(5,5) (5,6) (6,5) (6,6)

With n decision variables, there would 2n

(17)

Of all the rounded points, (5,5) is the only feasible point. All other points are

infeasible.

Two important facts about rounded solutions:

1. A rounded solution need not be optimal.

2. A rounded solution need not be near the optimal ILP solution.

(18)

Optimal solution to ILP Optimal solution to the LP relaxation. Feasible set for

LP relaxation

Integer points

(19)

Recall that Solver’s LP simplex method

makes use of the fact that the solution to an LP always lies on the boundary of the

feasible region.

Enumeration

Enumeration

Graphical Interpretation

Graphical Interpretation

Of Integer Models

Of Integer Models

Thus, Solver never has to consider any interior points of the feasible region.

For an ILP optimization, Solver might have to visit many integer points strictly within the interior of the feasible region, and thus, the LP simplex method cannot be used.

(20)

Once you identify all the integer feasible points in ILP, you could solve the model by

complete enumeration

complete enumeration (i.e., evaluate the

objective function at each integer point and then select the best one).

Unfortunately, complete enumeration of all the feasible integer points is not a

reasonable procedure for most ILPs.

For example, if you had 20 decision

variables, each of which could take on an

integer value between 1 and 50, then there would be 5020 (9.5x1023) points to

(21)

Applications of

Applications of

Binary Variables

Binary Variables

Binary (0-1) variables make it possible to incorporate yes/no decisions (called

dichotomous decisions) into an optimization model.

For example:

1. In a plant location model, let xj = 1 if we choose to have a plant at location j and xj = 0 if we do not.

2. In a routing model, let xijk = 1 if

truck k goes from city i to city j and xijk = 0 if it does not.

(22)

The use of 0-1 variables allows many variations of logical conditions in an

optimization model without resorting to any of Excel’s “=IF()” statements (which would not allow Solver to optimize the model).

Applications of

Applications of

Binary Variables

Binary Variables

(23)

The capital budgeting decision is a matter

of choosing among n alternatives in order to maximize the return, subject to constraints on the amount of capital invested over time.

Capital Budgeting:

Capital Budgeting:

An Expansion Decision

An Expansion Decision

Applications of

Applications of

Binary Variables

Binary Variables

For example, suppose that AutoPower’s

(24)

Expand Belgian Plant 400 100 50 200 100 0 Expand Sm. Machine Capacity in US 700 300 200 100 100 100 Establish New Plant in Chile 800 100 200 270 200 100 Expand Lg. Machine Capacity in US 1000 200 100 400 200 200 Capital Available 500 450 700 400 300 ALTERNATIVE PRESENT VALUE OF NET RETURN ($000s)

CAPTIAL REQUIRED IN YEAR BY ALTERNATIVE ($000s)

1 2 3 4 5

The Board must select one or more of these alternatives:

(25)

An ILP Model for Capital Budgeting at

An ILP Model for Capital Budgeting at

AutoPower:

AutoPower: This model can be modeled as

an ILP (called a binary or binary 0-1 ILP model) in 0-1 ILP which all the variables are binary variables. Let xi = 1 if project i is accepted and xi = 0 if project i is not accepted. The model

(26)

Max 400x1 + 700x2 + 800x3 + 1000x4 s.t. 100x1 + 300x2 + 100x3 + 200x4 < 500 50x1 + 200x2 + 200x3 + 100x4 < 450 200x1 + 100x2 + 270x3 + 400x4 < 700 100x1 + 100x2 + 200x3 + 200x4 < 400 100x2 + 100x3 + 200x4 < 300 xi = 0 or 1; i = 1, 2, 3, 4 Present value from accepted projects Capital required in year 1 Capital available in year 1

(27)

The LP Relaxation:

The LP Relaxation: First, approach this

model by solving the LP relaxation.

=SUMPRODUCT(Decisions, C5:F5) =H7-G7

Note: named ranges were used to improve readability of models.

(28)

Note that your solution may differ because the model has alternative optimal solutions.

In the LP relaxation model, xi was

constrained to be less than or equal to 1. This resulted in fractional values (0<xi<1) for the decision variables.

Since we are looking for 1’s (yes) and 0’s (no), these fractional values are not

meaningful. In addition, rounding these values would not work very well.

Rounding to: x1 = 1, x2 = 1, x3 = 0, x4 = 1 would result in an infeasible solution.

(29)

The optimal ILP solution can be obtained

using Solver’s integer programming option.integer programming Use the bin

option to force all four

of the decision variables to

(30)

The Premium Edition Solver for Education produces a different Solver Results

completion message for ILPs to remind you that the ILP solution may not be optimal.

(31)

The default Tolerance field on the Solver

Options dialog (relevant only for ILP

models) is 5%.

This means that the

Solver ILP optimization procedure is continued

only until the ILP solution OV is within 5% of the

ILP’s optimum OV.

A higher Tolerance speeds

up Solver at the risk of a reported solution further from the true ILP optimum.

Setting Tolerance to 0% forces Solver to find the ILP optimum but with much longer

(32)

An important use of binary variables is to impose constraints that arise from logical conditions.

Logical Conditions

Logical Conditions

Applications of

Applications of

Binary Variables

Binary Variables

No More Than No More Than kk of of nn Alternatives:

Alternatives:Let xi = 0 or 1, for i = 1, 2, …, n

The constraint

x1 + x2 + … + xn < k

implies that, at most, k alternatives of n possibilities can be selected (i.e., not

(33)

For example, adding the constraint: x1 + x3 < 1

to the previous AutoPower example, implies that the solution can contain at most one of the overseas alternatives.

Dependent Decisions:

Dependent Decisions: You can use 0-1

variables to force a dependent relationship on two or more decisions.

(34)

For example, suppose that AutoPower’s management does not want to select

alternative k unless it first selects

alternative m. The following constraint enforces this condition:

If alternative m is not selected, then xm = 0 which forces xk to be 0 (i.e., not selected).

xk < xm or equivalently xk - xm < 0

If alternative m is selected, then xm = 1 and xk < 1. Solver is then free to select 0 or 1

(35)

Lot Size Constraints:

Lot Size Constraints: A portfolio manager is considering purchasing security j. Let xj be the number of shares purchased. Consider the following constraints:

1. If he purchases security j, he must

purchase at least 200 shares (called a minimum lot size or minimum lot size batch sizebatch size

constraint)

2. He may not purchase more than 1000 shares of security j.

200 < xj < 1000

These constraints insist that xj always be at least 200. We want the conditions to be

(36)

To achieve the constraint conditions, use a binary variable, say yj, for security j.

If yj = 1, then purchase security j

The constraints are:

xj < 1000yj xj > 200yj

If y = 1, then the above constraints imply that 200 < xj < 1000 (purchase j).

If y = 0, then the above constraints imply that xj = 0 (do not purchase j).

If yj = 0, do not purchase security j These 2 constraints together guarantee

the “minimum lot size” constraint.

(37)

K

K of of mm Constraints: Constraints: In general notation, let the “superset” of m constraints on a

model’s (non-binary) decision variables, xi, be

gi(x1 , …, xn) < bi, for i = 1, …, m

Now, introduce m additional 0-1 decision variables yi to the model, and let M be

chosen as a very large number, so large that, for each i,

gi(xi , …, xn) < M

for every x satisfying any set of k inequalities taken from the above m.

(38)

The following m + 1 constraints express the desired condition:

m

i=1

yi = ki

This constraint forces exactly k of the new yi decision variables to have the value 1.

gi(x1 , …, xn) < bi yi + M(1- yi), i=1, …, m

Exactly k of the inequality constraints are equivalent to: gi(x1 , …, xn) < bi

The remaining m-k inequality constraints are equivalent to: gi(x1 , …, xn) < M

The very large number choice for M causes each such constraint to be redundant and not affect the model’s optimal solution.

(39)

K

K of of mm Constraints Example: Constraints Example: Assume a

company must find production quantities of three products (x1, x2, x3) as part of a large LP model.

Within the LP formulation, the company

must choose one or the other (but not both) of two different production technologies for the 3 products.

Here are the two constraints:

30x1 + 20x2 + 10x3 < 100 (Technology 1) 10x1 + 30x2 + 5x3 < 110 (Technology 2)

(40)

These constraints cannot be added directly to the LP model. Instead, add two new

binary decision variables (y1 and y2) to the LP model, making it an ILP model.

y1 = 1 “Solver, choose Technology 1”

y1 = 0 “Solver, do not choose Technology 1”

y2 = 1 “Solver, choose Technology 2”

(41)

The original constraints are then modified:

30x1 + 20x2 + 10x3 < 100y1 + 999999(1-y1) 10x1 + 30x2 + 5x3 < 110y2 + 999999(1-y2)

y1 + y2 = 1

Forces Solver to choose exactly one

technology option

999999 was chosen to guarantee that

one or the other constraint will be redundant for the

(42)

A Fixed Charge Model

A Fixed Charge Model

In order to conserve capital, STECO, an

electronics parts wholesaler, leases regional warehouses for its use.

The cost per month to lease warehouse i is Fi. Warehouse i can load a maximum of Ti trucks per month.

There are four sales districts, and the typical monthly demand in district j is dj truckloads.

The average cost of sending a truck from warehouse i to district j is cij.

(43)

STECO wants to know which warehouses to lease and how many trucks to send from

each warehouse to each district.

STECO pays no lease cost for a given warehouse unless at least one truck is

dispatched from it, and then it pays the full monthly lease amount.

Lot size models incorporating this cost

behavior are common and are called fixed fixed charge models

(44)

Here is the network flow diagram: A A BB CC 1 1 22 33 44 Leasing cost/mth for warehouses FA FB FC Capacity (truckloads) TA TB TC Warehouses Districts Demands per month d1 d2 d3 d4

(45)

Here are the data for this model: A 170 40 70 160 200 7750 B 150 195 100 10 250 4000 C 100 240 140 60 300 5500 Monthly Demand (truck loads) 100 90 110 60 WAREHOUSE Monthly Capacity (No. of Trucks) Cost Per Truck

Sales District ($) 1 2 3 4

Monthly Leasing Costs ($)

(46)

A Fixed Charge Model

A Fixed Charge Model

Modeling Considerations:

Modeling Considerations:

Define yi as a binary decision variable and let:

yi = 1 if warehouse i is leased

yi = 0 if warehouse i is not leased

Although it may seem logical to treat the

number of trucks sent from a warehouse to a district as an integer variable, in reality, there are three arguments as to why we should not:

(47)

1. This is a planning model, not a detailed operating model.

2. Treating the number of trucks as

integer variables may make the model more difficult to optimize.

3. It costs more to lease one of the

warehouses than to send a truck from a warehouse to a sales district.

(48)

A Fixed Charge Model

A Fixed Charge Model

The MILP Model

The MILP Model

To model STECO’s model as an MILP, let

yi = 1 if warehouse i is leased, i=A, B, C yi = 0 if warehouse i is not leased

xij = number of trucks sent from warehouse i to district j

(49)

Min 7750y

Min 7750yA A + 4000y+ 4000yBB + 5500y + 5500yCC + 170x + 170xA1A1 + … + 60x + … + 60xC4C4

Total leasing cost Total truck cost

xA1 + xB1 + xC1 > 100 demand at district 1

Demand Constraints:

xA2 + xB2 + xC2 > 90demand at district 2

xA3 + xB3 + xC3 > 110 demand at district 3

xA4 + xB4 + xC4 > 60demand at district 4

These four constraints guarantee that

demand will be satisfied at the respective sales district.

(50)

xA1 + xA2 + xA3 + xA4 < 200yA or

Capacity Constraints (for each warehouse):

These constraints serve 2 purposes:

xA1 + xA2 + xA3 + xA4 - 200yA < 0

1. It guarantees that capacity at warehouse i is not exceeded.

2. It forces STECO to lease warehouse i if anything is sent out of it.

xB1 + xB2 + xB3 + xB4 < 250yB xC1 + xC2 + xC3 + xC4 < 300yC

(51)

Here is the Solved spreadsheet model:

=J4*C9

(52)
(53)

In conclusion, the optimal solution to this model with integer supplies and demands will always include an integer allocation of trucks.

A Fixed Charge Model

A Fixed Charge Model

The argument involves two steps:

1. The optimal solution must lease some set of warehouses, and

2. Every possible set of leased warehouses yields an integer allocation of trucks.

(54)

Integer Optimization Methods

Integer Optimization Methods

Solver’s solution procedure for an ILP

model (called Branch-and-Bound) is as Branch-and-Bound follows for a maximization model:

1. Solve the original ILP formulation as a relaxed LP.

The OV for the relaxation is the ILP upper bound.

If the optimal solution is all-integer, it is optimal for the ILP, and so, quit.

(55)

2. If the LP relaxation has some integer variable at a fractional value, form two sub models from this parent branch so as to create two new unsolved LP models (the successors) with the

property that the optimal solution to one of the successor ILPs will be the optimal solution to the parent ILP.

Let xi* be any fractional variable of the

optimal solution to the parent’s relaxation.

Let [xi*] be the truncation of x

i* to its

(56)

Then, [xi*] + 1 is the next integer

larger than xi*.

One successor sub-model will be the parent’s LP model augmented by the constraint, xi < [xi*].

The other successor sub-model is

formed by augmenting the parent’s LP model with xi > [xi*] + 1.

(57)

3. Commence with any unsolved model in step 2. And optimize it as a relaxed LP sub-model.

If the optimal solution is all-integer, evaluate its objective function.

Compare the OV of the best ILP

model’s solution found so far with this relaxed sub-model’s OV.

If the relaxed sub-model’s OV is worse than the best ILP solution found so far, don’t continue. Instead, continue with another sub-model.

(58)

If the relaxed sub-model’s OV is not

worse than the best ILP solution found so far, then proceed to eliminate any other fractional variables it may have using the constraint augmentation

procedure by going back to step 2. If all remaining relaxed sub-models have integer solutions, go to step 4; otherwise, go back to step 2.

4. The optimal solution to the original ILP is the all-integer solution of some sub-model that produced the best

(59)

In the branch-and-bound method, the

original ILP is decomposed into a growing sequence of LP sub-models.

Solver uses numerous optimizations of increasingly augmented LP sub-model formulations to solve a given ILP.

Therefore, it is more time-consuming to optimize ILPs than LPs.

The operation of the branch-and-bound

procedure in Solver displays the following message in Excel’s lower left corner:

(60)

Integer Optimization Methods

Integer Optimization Methods

Sensitivity Analysis for ILPs

Sensitivity Analysis for ILPs

The Solver solution to an ILP does not contain any sensitivity information (as

evidenced by the lack of a Sensitivity option Sensitivity in the Solver Results dialog).Solver Results

An ILP solution does not include information that is equivalent to the shadow price,

reduced cost and objective coefficient sensitivity information in an LP.

(61)

Solutions to ILPs can be extremely sensitive to changes in parameter values. To

illustrate, consider the following capital budgeting model:

Although this model is easily solved by

inspection, consider the following optimal solution:

Max 10x1 + 100x2 + 1000x3 29x1 + 30x2 + 31x3 < b1 x1, x2, x3 are binary (0 or 1)

(62)

x1 x2 x3 29 1 0 0 10 30 0 1 0 100 31 0 0 1 1000 b1 Optimal Solution OV

Here are the sensitivity data for the model:

A change in the right-hand side of the

constraint increases the OV by a factor of 1000%.

(63)

Integer Optimization Methods

Integer Optimization Methods

Heuristic Methods:

Heuristic Methods:

Heuristic methods are designed to

efficiently produce “good,” although not necessarily optimal, solutions.

These methods will be discussed in a the next chapter.

Referências

Documentos relacionados