6 Integer Programming

advertisement
Integer Programming
‰In many problems the decision variables must have integer values.
™Example: assign people, machines, and vehicles to activities in integer quantities.
INTEGER PROGRAMMING
‰If this is the only deviation from linear programming, it ‰If this is the only deviation from linear programming
it is called an integer programming (IP) problem.
‰If only some variables are required to be integer, the model is called a mixed integer programming (MIP)
™San Francisco Police Dep. problem is an IP problem.
™Wyndor Glass Co. problem could be an IP problem; how? João Miguel da Costa Sousa / Alexandra Moutinho
Integer Programming
Prototype example
‰ California Manufacturing Company is considering expansion, building a factory in Los Angeles, San Francisco or in both cities.
‰ One new warehouse can also be considered in a city where a new factory is being built. Maximum $10 million to invest.
‰ Objective: find feasible combination of alternatives that maximizes the total net present value.
the total net present value
‰In integer programming the divisibility assumption must be dropped.
‰Another area of application relates to problems involving “yes‐or‐no” decisions, which have binary g
variables.
‰These IP problems are called binary integer programming (BIP) problems.
‰A small example of a typical BIP problem is given in the following.
João Miguel da Costa Sousa / Alexandra Moutinho
Decision number
262
Capital required
1
Build factory in Los Angeles?
x1
$9 million
$6 million
Build factory in San Francisco?
x2
$5 million
$3 million
3
Build warehouse in Los Angeles?
x3
$6 million
$5 million
4
Build warehouse in San Francisco?
x4
$4 million
$2 million
João Miguel da Costa Sousa / Alexandra Moutinho
263
‰Groups of yes‐or‐no decisions often constitute groups of mutually exclusive alternatives: only one decision in the group can be yes.
‰Occasionally, decisions of the yes‐or‐no type are contingent decisions: decision that depends upon previous ones.
¾ Software options for solving BIP, IP or MIP models:
⎧1 if decision j is yes,
xj =⎨
j = 1,2,3,4
⎩0 if decision j is no,
‰ Z = total net present value of these decisions.
Maximize Z = 9x1 + 5x2 + 6x3 + 4x4.
‰ Constraints:
6x1 + 3x2 + 5x3 + 2x4 ≤ 10
Mutually exclusive alternatives
Contingent decisions
xj is binary, for j = 1,2,3,4.
João Miguel da Costa Sousa / Alexandra Moutinho
Decision Net present variable
value
BIP models
‰ All decision variables have the binary form:
x3 ≤ x1 and x4 ≤ x2
Yes‐or‐no question
2
BIP model
x3 + x4 ≤ 1
261
264
ƒ
ƒ
ƒ
ƒ
Excel MatLab
LINGO/LINDO
MPL/CPLEX
João Miguel da Costa Sousa / Alexandra Moutinho
265
1
BIP applications
Formulation examples
‰Investment analysis, such as the California Man. Co.
‰Site selection, of factories, warehouses, etc.
‰Designing a production and distribution network, or more generally the entire global supply‐chain.
‰Dispatching shipments, scheduling routes, vehicles and time period for departure and arrivals.
‰Airline applications, as e.g. fleet assignment and crew scheduling.
‰Scheduling interrelated activities, asset divestures, etc.
João Miguel da Costa Sousa / Alexandra Moutinho
266
Example 1
™Example 1: making choices when decision variables are continuous. R&D Division of Good Products Co. has developed three possible new products.
ƒ Requirement 1: from the three, at most two can be chosen to be produced.
™Each product can be produced in either of two plants. However, management has imposed another restriction:
ƒ Requirement 2: just one of the two plants can be chosen as the producer of the new products.
João Miguel da Costa Sousa / Alexandra Moutinho
267
Formulation of the problem
Production time used for each unit produced
Production time available per week
Product 1
Product 2
Product 3
Plant 1
3 hours
4 hours
2 hours
30 hours
Plant 2
4 hours
6 hours
2 hours
40 hours
Unit profit
5
7
3
(103 $)
Sales potential
7
5
9
(units per week)
‰ Similar to a standard product mix problem, such as the Wyndor Glass Co. if we drop the two restrictions and require each product to use production hours in both plants.
‰ Let x1, x2, x3 be the production rates of the respective products:
Maximize Z = 5 x 1 + 7 x2 + 3 x 3
subject to 3 x 1 + 4 x2 + 2 x 3 ≤ 30
4 x 1 + 6 x2 + 2 x 3 ≤ 40
x1 ≤ 7
x2 ≤ 5
x3 ≤ 9
‰Objectives: choose the products, the plant and the production rates of the chosen products to maximize total profit.
João Miguel da Costa Sousa / Alexandra Moutinho
268
Formulation of the problem
269
Auxiliary binary variables
‰ For requirement 1, three auxiliary binary variables (y1, y2, y3) are introduced:
‰For real problem, restriction 1 adds the constraint:
Number of strictly positive variables (x1, x2, x3) must be ≤ 2
ƒ This must be converted to an IP problem. It needs the introduction of auxiliary binary variables.
if x j > 0 can hold (can produce product j )
⎧1
yj =⎨
0
if x j = 0 must hold (cannot produce product j )
⎩
‰ This is introduced in the model with the help of an extremely large positive number M, adding the constraints:
‰Restriction 2 requires replacing the first two functional constraints by:
x 1 ≤ My 1
x2 ≤ My2
x 3 ≤ My 3
Either 3 x 1 + 4 x2 + 2 x 3 ≤ 30 or 4 x 1 + 6 x2 + 2 x 3 ≤ 40 must hold.
y1 + y2 + y 3 ≤ 2
This again requires an auxiliary binary variable.
João Miguel da Costa Sousa / Alexandra Moutinho
x 1 , x2 , x 3 ≥ 0
João Miguel da Costa Sousa / Alexandra Moutinho
y j is binary, for j = 1,2,3.
270
João Miguel da Costa Sousa / Alexandra Moutinho
271
2
Auxiliary binary variables
Complete model (MIP)
Maximize Z = 5 x 1 + 7 x2 + 3 x 3
subject to
x1 ≤ 7
‰ For requirement 2, another auxiliary binary variable y4 is introduced:
⎧1
y4 = ⎨
⎩0
x2 ≤ 5
x3 ≤ 9
if 4x 1 + 6 x 2 + 2 x 3 ≤ 40 must hold (choose Plant 2)
if 3x 1 + 4 x 2 + 2 x 3 ≤ 30 must hold (choose Plant 1)
x 1 − My 1 ≤ 0
x2 − My2 ≤ 0
x 3 − My 3 ≤ 0
‰ This adds the constraints:
3 x 1 + 4 x2 + 2 x 3 ≤ 30 + My 4
y 1 + y2 + y 3 ≤ 2
4 x 1 + 6 x2 + 2 x 3 ≤ 40 + M (1 − y 4 )
3 x 1 + 4 x2 + 2 x 3 − My 4 ≤ 30
y 4 is binary
4 x 1 + 6 x2 + 2 x 3 + My 4 ≤ 40 + M
and
João Miguel da Costa Sousa / Alexandra Moutinho
272
Solution
João Miguel da Costa Sousa / Alexandra Moutinho
273
‰Southwestern Airways needs to assign three crews to cover all the upcoming flights.
‰Table shows the flights in the first column. ƒ Other 12 columns show the 12 feasible sequences of flights for a crew.
for a crew
ƒ Numbers in each column indicate the order of the flights.
ƒ Exactly three sequences must be chosen (one per crew).
ƒ More than one crew can be assigned to a flight, but it must be paid as if it was working.
ƒ Last row shows the cost of assigning a crew to a particular sequence of flights.
274
Data for Southwestern Airways
1
1. San Francisco to Los Angeles
1
2. San Francisco to Denver
2
3
4
5
6
1
1
3. San Francisco to Seattle
7
1
1
4. Los Angeles to Chicago 3
4
4
3
9. Denver to Chicago 1
3
4
4
7
8
2
3
João Miguel da Costa Sousa / Alexandra Moutinho
4
6
7
1
2
3
5
5
3
3
2
2
11. Seattle to Los Angeles
3
275
4
‰Objective: minimize the total cost for the three crew assignments that cover all flights.
‰12 feasible sequences of flights: 12 yes‐or‐no decisions:
Should sequence j be assigned to a crew?
‰The 12 binary variables to represent the decisions are:
5
2
10. Seattle to San Francisco
12
4
7. Chicago to Seattle
2
11
1
3
3
10
1
2
2
6. Chicago to Denver
2
9
1
1
2
8. Denver to San Francisco
8
1
João Miguel da Costa Sousa / Alexandra Moutinho
Formulation of the problem
Feasible sequence of flights
Flight
Cost (1000€)
João Miguel da Costa Sousa / Alexandra Moutinho
Example: Southwestern Airways
‰MIP problem with 3 continuous and four binary variables.
‰Optimal solution: y1 = 1, y
1, y2 = 0, y
0, y3 = 1, y
1, y4 = 1, x
1, x1 = 5.5, x
5.5, x2 = 0, x
0, x3 = 9.
9.
‰That is, produce products 1 and 3 with production rates 5.5 units per week and 9 units per week respectively, and choose Plant 2 for production.
‰Resulting total profit is $54,500 per week.
5. Los Angeles to San Francisco
x i ≥ 0, for i = 1,2,3
y j is binary, for j = 1,2,3,4
5
2
5
2
4
4
2
9
9
8
9
276
⎧1
xj =⎨
⎩0
if sequence j is assigned to a crew
otherwise
João Miguel da Costa Sousa / Alexandra Moutinho
277
3
Formulation of the problem
Solution Minimize Z = 2 x 1 + 3 x2 + 4 x 3 + 6 x4 + 7 x 5 + 5 x 6 + 7 x 7 + 8 x 8 + 9 x 9
+9 x 10 + 8 x11 + 9 x 12
subject to
x 1 + x 4 + x 7 + x10 ≥ 1 (SF to LA)
x2 + x 5 + x 8 + x 11 ≥ 1
x 3 + x 6 + x 9 + x 12 ≥ 1
x 4 + x 7 + x 9 + x 100 + x 122 ≥ 1
x 1 + x 6 + x 10 + x 11 ≥ 1
x4 + x5 + x9 ≥ 1
x 7 + x 8 + x 10 + x 11 + x 12 ≥ 1
x2 + x 4 + x 5 + x9 ≥ 1
x 5 + x 8 + x 11 ≥ 1
x 3 + x 7 + x 8 + x 12 ≥ 1
x 6 + x 9 + x 10 + x 11 + x 12 ≥ 1
12
∑x
j =1
João Miguel da Costa Sousa / Alexandra Moutinho
j
and x j is binary,
for j = 1,2,… ,12
‰One optimal solution is:
ƒ
ƒ
ƒ
ƒ
x3 = 1 (assign sequence 3 to a crew)
x4 = 1 (assign sequence 4 to a crew)
x11 = 1 (assign sequence 11 to a crew)
And all other xj = 0.
‰Total cost is $18,000.
‰Another optimal solution is: x1 = x5 = x12 = 1.
= 3 (assign three crews)
278
Discussion
João Miguel da Costa Sousa / Alexandra Moutinho
279
Solving IP problems
‰ This example belongs to a class called set covering problems, with a number of potential activities (e.g. flight sequences) and characteristics (e.g. flights).
‰ Objective: determine the least costly combination of activities that collectively possess each characteristic at least once.
‰ Si is the set of all activities that possess characteristic i.
‰ A constraint is included for each characteristic i:
∑x
j∈Si
j
≥1
‰ In set partitioning problems the constraint is
∑x
j∈S j
j
=1
João Miguel da Costa Sousa / Alexandra Moutinho
280
Solving IP problems
ƒ Difference to LP is that IP have far fewer solutions.
ƒ IP problems have a finite number of feasible solutions.
‰However:
¾ Finite numbers can be astronomically large! With n
Fi it b b t
i ll l
! With variables a BIP problem has 2n solutions, having exponential growth.
¾ LP assures that a CPF solution can be optimal, guaranteeing the remarkable efficiency of the simplex method. LP problems are much easier to solve than IP LP problems are much easier to solve than IP problems!!
problems
João Miguel da Costa Sousa / Alexandra Moutinho
281
Solving IP problems
‰ Consequently, most IP algorithms incorporate the simplex method. This is called the LP relaxation.
‰ Sometimes, the solution of the LP problem is the solution of the IP problem, such as :
‰ Primary determinants of computational complexity:
1. number of integer variables,
2. these variables are binary or general integer variables,
3. any special structure in the problem.
‰ This is in contrast to LP, where number of constraints is much more important than the number of variables.
‰ As IP problems are much more difficult than LP, we could apply LP and round the obtained solution... Yes?
ƒ Minimum cost flow problem, including transportation problem, assignment problem, shortest‐path problem and maximum flow problem.
‰ Special structures (see examples 2 and 3): mutually exclusive alternatives, contingent decisions or set‐
covering constraints can also simplify the problem.
João Miguel da Costa Sousa / Alexandra Moutinho
‰ Are integer problems easy to solve?
282
João Miguel da Costa Sousa / Alexandra Moutinho
283
4
Example 1
Example 2
Minimize
Z = x2
subject to − x 1 + x2 ≤ 0.5
x 1 + x2 ≤ 3.5
x 1 , x2 ≥ 0,
and
Minimize Z = x 1 + 5 x2 subject to x 1 + 10 x2 ≤ 20
x 1 ≤ 2 and x 1 , x2 ≥ 0, integers.
x 1 , x2 integers.
João Miguel da Costa Sousa / Alexandra Moutinho
284
Solving IP problems
ƒ These algorithms will be discussed later.
‰ Pure IP problems can consider some type of enumeration procedure.
‰ This should be done in a clever way such that only a tiny fraction of the feasible solutions is examined.
‰Branch‐and‐bound with a divide to conquer
technique can be used. ƒ dividing (branching) the problem into smaller and smaller subproblems until it can be conquered
ƒ conquering (fathoming) by bounding how good the best solution can be. If no optimal solution in subset: discard it.
‰ Most popular traditional method for solving IP problems is the branch‐and‐bound technique.
286
Example: California Manuf, Co.
João Miguel da Costa Sousa / Alexandra Moutinho
287
Branching
‰ Most straightforward way to divide the problem: fix the value of a variable:
‰ Recall prototype example:
Maximize Z = 9x1 + 5x2 + 6x3 + 4x4
subject to
ƒ e.g. x1 = 0 for one subset and x1 = 1 for another subset.
¾Subproblem
p
1 (fix x1 = 0):
(1) 6x1 + 3x2 + 5x3 + 2x4 ≤ 10
(2) x3 + x4 ≤ 1
x3
≤0
(3) – x1 + x4 ≤ 0
(4) – x2 + Maximize Z = 5x2 + 6x3 + 4x4
subject to
(1) 3x2 + 5x3 + 2x4 ≤ 10
(2)
x3 + x4 ≤ 1
≤0
(3)
x3
x4 ≤ 0
(4) – x2 +
(5) xj is binary, for j = 2, 3, 4.
and (5) xj is binary, for j = 1, 2, 3, 4.
João Miguel da Costa Sousa / Alexandra Moutinho
285
Branch‐and‐bound applied to BIP
‰ Thus, a better approach to deal with IP problems that are too large to be solved exactly are heuristic algorithms.
‰ Heuristics and metaheuristics are extremely efficient for very large problems, but do not guarantee to find an optimal solution.
João Miguel da Costa Sousa / Alexandra Moutinho
João Miguel da Costa Sousa / Alexandra Moutinho
288
João Miguel da Costa Sousa / Alexandra Moutinho
¾Subproblem 2 (fix x1 = 1):
Maximize Z = 9 + 5x2 + 6x3 + 4x4
subject to
(1) 3x2 + 5x3 + 2x4 ≤ 4
(2)
x3 + x4 ≤ 1
≤1
(3)
x3
x4 ≤ 0
(4) – x2 +
(5) xj is binary, for j = 2, 3, 4.
289
5
Branching
Bounding
‰ Dividing (branching) into suproblems creates a tree
with branches (arcs) for the All node. ‰ This is the solution tree or enumeration tree.
‰Branching variable is the one used for branching.
‰ The branching continues or not after evaluating the subproblem.
‰ Other IP problems usually creates as many branches as needed.
‰ A bound is needed for the best feasible solution of each of the subproblems.
‰ Standard way is to perform a relaxation of the g
g one set of constraints that problem, e.g. by deleting
makes the problem difficult to solve.
‰ Most common is to require integer variables, so LP relaxation is the most widely used.
João Miguel da Costa Sousa / Alexandra Moutinho
João Miguel da Costa Sousa / Alexandra Moutinho
290
Bounding in example Fathoming
‰ A subproblem can be conquered (fathomed, i.e. search tree is pruned) in three ways:
1. When the optimal solution for the LP relaxation of a subproblem is integer, it must be optimal.
™ Example
E
l : for f x1=0, (
(x1, x2, x3, x4) = (0, 1, 0, 1), is integer.
) ( ) i i
™ Example: for the whole problem, (5) is replaced by xj ≤ 1 and xj ≥ 0 for j=1,2,3,4. Using simplex:
ƒ (x1, x2, x3, x4) = (5/6, 1, 0, 1), with Z = 16.5
ƒ Thus, Z ≤
,
16.5 for all feasible solutions for BIP 5
problem. Can be rounded to Z ≤ 16 (why?)
ƒ LP relaxation for subproblem 1 (x1=0): ƒ (x1, x2, x3, x4) = (0, 1, 0, 1), with Z = 9
ƒ LP relaxation for subproblem 2 (x1=1): ƒ (x1, x2, x3, x4) = (1, 4/5, 0, 4/5), with Z = 16.5
João Miguel da Costa Sousa / Alexandra Moutinho
ƒ
It must be stored as first incumbent (best feasible solution found so far) for the whole problem, along with value of Z:
Z* = value of Z for first incumbent
™ In the example Z* = 9.
ƒ Subproblem 1 is solved, so it is fathomed (dismissed).
292
João Miguel da Costa Sousa / Alexandra Moutinho
Fathoming
™ In Subproblem
p
2 that does not occur, the bound of 16 is ,
larger than 9. However, it can occur for descendants.
As new incumbents with larger values of Z* are found, it becomes easier to fathom in this way.
3. If the simplex method finds that a subproblem’s LP relaxation has no feasible solution, the subproblem
has no feasible solution and can be dismissed.
João Miguel da Costa Sousa / Alexandra Moutinho
293
Summary of fathoming tests
2. As Z* = 9, we should not consider subproblems with bound ≤ 9. Thus, a problem is fathomed when
Bound ≤ Z*
ƒ
291
294
‰
¾
or
¾
or
¾
A subproblem is fathomed (dismissed) if
Test 1: Its bound ≤ Z*
Test 2: Its LP relaxation has no feasible solutions
Test 3: Optimal solution for its LP relaxation is integer. ƒ
If better, this solution becomes new incumbent, and Test 1 is reapplied for all unfathomed subproblems.
João Miguel da Costa Sousa / Alexandra Moutinho
295
6
Fathoming in example
BIP branch‐and‐bound algorithm
Initialization: Set Z* = – ∞. Apply bounding, fathoming and optimization steps described below to the whole problem. If not fathomed, perform iteration.
Steps for each iteration:
1. Branching: Among the remaining subproblems, select the one created most recently. Branch from this node by fixing the next variable as either 0 or 1. 2. Bounding: For each new subproblem, obtain its bound by applying its LP relaxation.
‰ Result of applying the three tests is in figure below.
ƒ Subproblem 1 is fathomed by test 3.
ƒ
João Miguel da Costa Sousa / Alexandra Moutinho
296
BIP branch‐and‐bound algorithm
Round down Z for resulting optimal solution.
João Miguel da Costa Sousa / Alexandra Moutinho
Completing example
3. Fathoming: For each new subproblem, apply the three fathoming tests, and discard subproblems
that are fathomed by the tests.
Optimality test:
y
Stop when there are no remaining g
subproblems. The current incumbent is optimal. Otherwise, perform another iteration.
Iteration 2. Remaining subproblems are for x1 = 1.
¾ Subproblem 3
((fix x1 = 1, x
, 2 = 0):
)
Maximize Z = 9 + 6x3 + 4x4
subject to
(1) 5x3 + 2x4 ≤ 4
(2) x3 + x4 ≤ 1
≤1
(3) x3
(4) x4 ≤ 0
(5) xj is binary, for j = 3, 4.
João Miguel da Costa Sousa / Alexandra Moutinho
297
298
Example
João Miguel da Costa Sousa / Alexandra Moutinho
¾ Subproblem 4
((fix x1 = 1, x
, 2 = 1):
)
Maximize Z = 14 + 6x3 + 4x4
subject to
(1) 5x3 + 2x4 ≤ 1
(2) x3 + x4 ≤ 1
≤1
(3) x3
(4) x4 ≤ 1
(5) xj is binary, for j = 3, 4.
299
Example
™ LP relaxation is obtained by replacing (5) by 0 ≤ xj ≤ 1 j = 3, 4. Optimal solutions are:
ƒ LP relaxation for subproblem 3: ƒ (x1, x2, x3, x4) ) = (1, 0, 0.8, 0), with Z
(1, 0, 0.8, 0), with Z = 13.8
13.8
ƒ LP relaxation for subproblem 4: ƒ (x1, x2, x3, x4) = (1, 1, 0, 0.5), with Z = 16
ƒ Resulting bounds: ƒ All three fathoming tests fail, so both are unfathomed.
ƒ Bound for subproblem 3: Z ≤ 13
ƒ Bound for subproblem 4: Z ≤ 16
João Miguel da Costa Sousa / Alexandra Moutinho
300
João Miguel da Costa Sousa / Alexandra Moutinho
301
7
Iteration 3
Iteration 3 (cont.)
™ LP relaxation: replace (5) by 0 ≤ x4 ≤ 1. Optimal solutions are:
ƒ LP relaxation for subproblem 5: (x1, x2, x3, x4) = (1, 1, 0, Subproblem 4 has the larger bound, so next branching is done from (x1, x2) = (1, 1).
¾ Subproblem 5
(fix x1 = 1, x2 = 1, x3 = 0):
Maximize Z = 14 + 4x4
subject to
(1) 5x3 + 2x4 ≤ 1
(2), (4) x4 ≤ 1
(5) x4 is binary
João Miguel da Costa Sousa / Alexandra Moutinho
0.5), Z = 16
ƒ LP relaxation for subproblem 6: No feasible solutions.
6 No feasible solutions
¾ Subproblem 6
(fix x1 = 1, x2 = 1, x3 = 1):
Maximize Z = 20 + 4x4
subject to
(1) 2x4 ≤ –4
(2) x4 ≤ 0
(4) x4 ≤ 1
(5) x4 is binary
ƒ Bound for subproblem 5: Z ≤ 16
ƒ Subproblem 6 is fathomed by test 2, but not subproblem 5.
302
Iteration 3 (concl.)
João Miguel da Costa Sousa / Alexandra Moutinho
303
Iteration 4
™ Node created most recently is selected for branching:
ƒ x4 = 0: (x1, x2, x3, x4) = (1, 1, 0, 0) is feasible, with Z = 14,
ƒ x4 = 1: (x1, x2, x3, x4) = (1, 1, 0, 1) is infeasible.
ƒ First solution passes test 3 (integer solution) and second passes test 2 (infeasible) for fathoming. ƒ First solution is better than incumbent, so it becomes new incumbent, with Z* = 14
ƒ Reapplying fathoming test 1 (bound) to remaining branch of Subproblem 3:
ƒ Bound = 13 ≤ Z* = 14 (fathomed).
João Miguel da Costa Sousa / Alexandra Moutinho
304
Solution tree after Iteration 4
João Miguel da Costa Sousa / Alexandra Moutinho
305
Other options in Branch‐and‐Bound
‰Branching can be done e.g. from the best bound
rather than from the most recently created
subproblem.
‰Bounding is done by solving a relaxation. Another possible one is e.g. the Lagrangian
p
g
g g relaxation.
‰Fathoming criteria can be generally stated as:
ƒ Crit. 1: feasible solutions of subproblem must have Z ≤ Z*,
ƒ Crit. 2: the subproblem has no feasible solutions, or
ƒ Crit. 3: an optimal solution of subproblem has been found.
‰ Some adjustments necessary for Branch‐and‐bound to find multiple optimal solutions.
João Miguel da Costa Sousa / Alexandra Moutinho
306
João Miguel da Costa Sousa / Alexandra Moutinho
307
8
Branch‐and‐bound for MIP
Branch‐and‐bound for MIP
‰ General form of the problem:
‰ Similar to BIP algorithm. Solving LP relaxations are the basis for bounding and fathoming.
n
Maximize
Z = ∑c j x j
j =1
n
subject to
∑a x
j =1
and
ij
j
‰ 4 changes are needed:
1. Choice of branching variable. Only integer variables
that have a noninteger value in the optimal solution for the LP relaxation can be chosen.
≤ bi , for i = 1,2,… , m,
x j ≥ 0, for j = 1,2,… , n
x j is integer, for j = 1,2,… , I ; I ≤ n.
João Miguel da Costa Sousa / Alexandra Moutinho
308
João Miguel da Costa Sousa / Alexandra Moutinho
Branch‐and‐bound for MIP
309
Recurring branching variable 2. As integer variables can have a large number of possible values, create just two new subproblems:
ƒ
ƒ
ƒ
xj*: noninteger value of optimal solution for LP relaxation.
[xj*] = greatest integer ≤ xj*.
Range of variables for two new subproblems:
f
bl f
b bl
xj* ≤ [xj*] and xj* ≥ [xj*] + 1.
ƒ Each inequality becomes an additional constraint.
™ Example: xj* = 3.5, then: xj* ≤ 3 and xj* ≥ 4.
¾ When changes 1. and 2. are combined a recurring branching variable can occur, see figure.
João Miguel da Costa Sousa / Alexandra Moutinho
310
João Miguel da Costa Sousa / Alexandra Moutinho
Branch‐and‐bound for MIP
MIP branch‐and‐bound algorithm
‰ Changes needed:
3. Bounding step: value of Z was rounded down in BIP algorithm. Now some variables are not integer‐
restricted so bound is value of Z without rounding.
g
4. Fathoming test 3: optimal solution for the subproblem’s LP relaxation must only be integer for integer‐restricted variables.
Initialization: Set Z* = – ∞. Apply bounding, fathoming and optimization steps described below to the whole problem. If not fathomed, perform iteration.
Steps for each iteration:
1. Branching: Among the remaining subproblems, h
h
b bl
select the one created most recently. ƒ
ƒ
João Miguel da Costa Sousa / Alexandra Moutinho
311
312
From integer variables that have a noninteger value in the optimal solution for the LP relaxation choose the first one. Let xj be this variable and xj* its value. Branch from this creating two subproblems by adding the respective constraints: xj* ≤ [xj*] and xj* ≥ [xj*] + 1.
João Miguel da Costa Sousa / Alexandra Moutinho
313
9
MIP branch‐and‐bound algorithm
MIP branch‐and‐bound algorithm
3. Fathoming (cont.):
2. Bounding: For each new subproblem, obtain its bound by applying its LP relaxation. ƒ
Test 3: Optimal solution for its LP relaxation has integer values for integer‐restricted variables. (If this solution is better it becomes new incumbent, and test 1 is reapplied for all p
)
unfathomed subproblems).
Use Z without rounding for resulting optimal solution.
33. Fathoming:
g For each new subproblem, apply the p
pp y
three fathoming tests, and discard subproblems that are fathomed by the tests.
Optimality test: Stop when there are no remaining subproblems. The current incumbent is optimal. Otherwise, perform another iteration.
Test 1: Its bound ≤ Z*, where Z* is value of Z for current incumbent.
Test 2: Its LP relaxation has no feasible solutions.
João Miguel da Costa Sousa / Alexandra Moutinho
™ See MIP examples in PL#7 and in page 518 of Hillier’s book.
314
João Miguel da Costa Sousa / Alexandra Moutinho
Branch‐and‐cut approach to BIP
Automatic problem processing for BIP
‰ “Computer inspection” of IP formulation to spot reformulations that make the problem quicker to solve:
‰ Branch‐and‐bound was develop and refined in the 60’s and early 70’s.
ƒ Can solve problems up to 100 variables.
‰ Branch‐and‐cut approach
pp
was introduced in the mid 80’s, and can solve problems with thousands of variables.
ƒ Only solve large problems if they are sparse (less than 5 or even 1% of nonzero values in functional constraints).
‰ Uses a combination of automatic problem processing, generation of cutting planes and B&B techniques.
João Miguel da Costa Sousa / Alexandra Moutinho
316
¾ Fixing variables: identify variables that can be fixed at 0 or ,
p
1, because other value cannot lead to feasible and optimal solution.
¾ Eliminating redundant constraints: identify and eliminate constraints that are automatically satisfied by solutions that satisfy all other constraints.
¾ Tightening constraints: tighten constraints in a way that reduces feasible region of LP relaxation without eliminating any feasible solutions for the BIP problem.
João Miguel da Costa Sousa / Alexandra Moutinho
Tightening constraints
‰ LP relaxation including feasible region.
315
317
Generating cutting planes for BIP
‰ LP relaxation after tightening constraint.
‰ Cutting plane (or cut) is a new functional constraint that reduces feasible region for LP relaxation without eliminating any feasible solutions of IP problem.
‰ Procedure for generating cutting planes:
1.
Consider functional constraint in ≤ form with only nonnegative coefficients.
2. Find a group of N variables such that
a) Constraint is violated if every variable in group = 1 and all other variables = 0.
b) It is satisfied if value of any variables changes from 1 to 0.
3.
Resulting cutting plane: sum of variables in group ≤ N – 1.
João Miguel da Costa Sousa / Alexandra Moutinho
318
João Miguel da Costa Sousa / Alexandra Moutinho
319
10
Constraint Programming
Stating constraints
‰ Combination of artificial intelligence with computer programming languages in the mid‐80’s.
‰ Flexibility in stating (nonlinear) constraints:
1 Mathematical constraints, e.g., x
1.
Mathematical constraints e g x + y < z.
< z
2. Disjunctive constraints, e.g., times of certain tasks cannot overlap.
3. Relational constraints, e.g., at least three tasks should be assigned to a certain machine.
João Miguel da Costa Sousa / Alexandra Moutinho
320
Example
João Miguel da Costa Sousa / Alexandra Moutinho
321
Constraint Programming
‰ Steps in Constraint Programming:
1. Formulate a compact model for the problem by using a variety of constraint types (most not of IP type).
2. Efficiently find feasible solutions that satisfy all ff
f f
f
these constraints.
3. Search among feasible solutions for an optimal one.
¾ Strength of constraint programming is in first two steps, whereas the main strength of IP is in step 3.
¾ Current research: integrate CP and IP!
‰ Consider:
ƒ x1∈{1,2}, x2∈{1,2}, x3∈{1,2,3}, x4∈{1,2,3,4,5}
ƒ Constraints:
1. All variables must have different values;
2. x1 +x3 = 4
ƒ
4. Explicit constraints, e.g., x and y have same domain {1,2,3,4,5}, but (x, y) must be (1, 1), (2, 3) or (4, 5).
5. Unary constraints, e.g. z is integer between 5 and 10.
6 Logical constraints, e.g., if x
6.
L i l t i t if = 5, then y
th ∈ [6, 8].
[6 8]
¾ Allows use of standard logical functions such as IF, AND, OR, NOT.
¾ Constraint programming applies domain reduction
and constraint propagation.
¾ The process creates a tree search.
Apply domain reduction and constraint propagation to obtain feasible solutions: x1∈{1}, x2∈{2}, x3∈{3}, x4∈{4,5}.
João Miguel da Costa Sousa / Alexandra Moutinho
322
João Miguel da Costa Sousa / Alexandra Moutinho
323
11
Download