Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
537 views

Operations Research: Integer Programming

The document discusses integer programming and various integer programming models. It provides examples of integer programming problems in areas like scheduling, manufacturing, and capital budgeting. Integer programming problems involve variables that must take on integer values. The linear programming relaxation of an integer program involves removing the integrality constraints. Branch-and-bound is an algorithm that solves integer programs by solving linear programming relaxations of subproblems formed by branching on integer variables.

Uploaded by

Andri Indriawan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
537 views

Operations Research: Integer Programming

The document discusses integer programming and various integer programming models. It provides examples of integer programming problems in areas like scheduling, manufacturing, and capital budgeting. Integer programming problems involve variables that must take on integer values. The linear programming relaxation of an integer program involves removing the integrality constraints. Branch-and-bound is an algorithm that solves integer programs by solving linear programming relaxations of subproblems formed by branching on integer variables.

Uploaded by

Andri Indriawan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 42

Operations Research

Integer Programming
Introduction to integer programming
 An Integer programming (IP) in which all
variables are required to be integers is call a pure
integer programming problem.
 An IP in which only some of the variables are
required to be integers is called a mixed integer
programming problem.
 An integer programming problem in which all the
variables must be 0 or 1 is called a 0-1 IP.
 The LP obtained by omitting all integer or 0-1
constraints on variables is called LP relaxation of
the IP.
2
Introduction to integer programming
 ILPs occur frequently
 Scheduling workers
 Manufacturing airplanes

 Integer variables also allow us to build more


accurate models for a number of common
business problems.

3
Integrality conditions

Max: 350x1 + 300x2 } profit


S.T.: x1 + x2 <= 200 } pumps
9x1 + 6x2 <= 1566 } labor
12x1 + 16x2 <= 2880 } tubing
x1, x2>= 0 } nonnegativity
x1, x2 must be integers } integrality

Integrality conditions are easy to state but make the


problem much more difficult (and sometimes
impossible) to solve.
4
Binary variables

 Binary variables are integer variables that can


assume only two values: 0 or 1.
 These variables can be useful in a number of
practical modeling situations.

5
ILP Models
Models names Applications
Assignment Airline Scheduling

Facility Location Airline Yield Management


Manpower Scheduling
Knapsack
Network Reliability and Design
Machine Scheduling
Supply Chain Management
Set Covering , Packing, Partitioning

Shortest Path

Traveling Salesman

6
Example: California manufacture company

Yes-or-No Capital (in $000s) Required in


Decision NPV Capital Req.
1 Factory in LA $9m $6m
2 Factory in SF $5m $3m
3 Warehouse in LA $6m $5m
4 Warehouse in SF $4m $2m

 The company currently has $10m available to invest in new


projects. It is considering building at most one warehouse, which is
restricted to a city where a new factory is being built.

7
Example: Capital budgeting - CRT Technologies

Expected NPV Capital (in $000s) Required in


Project (in $000s) Year 1 Year 2 Year 3 Year 4 Year 5
1 $141 $75 $25 $20 $15 $10
2 $187 $90 $35 $0 $0 $30
3 $121 $60 $15 $15 $15 $15
4 $83 $30 $20 $10 $5 $5
5 $265 $100 $25 $20 $20 $20
6 $127 $50 $20 $10 $30 $40

 The company currently has $250,000 available to invest in new


projects. It has budgeted $75,000 for continued support for these
projects in year 2 and $50,000 per year for years 3, 4, and 5.

8
Defining the decision variables
1, if project i is selected
x  i  1, 2,...,6
i  0, otherwise

Defining the objective function


Maximize the total NPV of selected projects.

Max: 141x1 + 187x2 + 121x3 + 83x4 + 265x5 + 127x6

9
Defining the constraints

 Capital constraints
75x1 + 90x2 + 60x3 + 30x4 + 100x5 + 50x6 ≤ 250 } year 1
25x1 + 35x2 + 15x3 + 20x4 + 25x5 + 20x6 ≤ 75 } year 2
20x1 + 0x2 + 15x3 + 10x4 + 20x5 + 10x6 ≤ 50 } year 3
15x1 + 0x2 + 15x3 + 5x4 + 20x5 + 30x6 ≤ 50 } year 4
10x1 + 30x2 + 15x3 + 5x4 + 20x5 + 40x6 ≤ 50 } year 5

 Binary constraints
All xi must be binary

10
Example: An employee scheduling problem

Day of Week Workers Needed Shift Days Off Wage


Sunday 18 1 Sun & Mon $680
Monday 27 2 Mon & Tue $705
Tuesday 22 3 Tue & Wed $705
Wednesday 26 4 Wed & Thr $705
Thursday 25 5 Thr & Fri $705
Friday 21 6 Fri & Sat $680
Saturday 19 7 Sat & Sun $655

11
Defining the decision variables
x1 = the number of workers assigned to shift 1
x2 = the number of workers assigned to shift 2
x3 = the number of workers assigned to shift 3
x4 = the number of workers assigned to shift 4
x5 = the number of workers assigned to shift 5
x6 = the number of workers assigned to shift 6
x7 = the number of workers assigned to shift 7

12
Defining the objective function
Minimize the total wage expense.
Min: 680x1 +705x2 +705x3 +705x4 +705x5 +680x6 +655x7

Defining the constraints


 Workers required each day
0x1 + 1x2 + 1x3 + 1x4 + 1x5 + 1x6 + 0x7 ≥ 18 } Sunday
0x1 + 0x2 + 1x3 + 1x4 + 1x5 + 1x6 + 1x7 ≥ 27 } Monday
1x1 + 0x2 + 0x3 + 1x4 + 1x5 + 1x6 + 1x7 ≥ 22 }Tuesday
1x1 + 1x2 + 0x3 + 0x4 + 1x5 + 1x6 + 1x7 ≥ 26 } Weds.
1x1 + 1x2 + 1x3 + 0x4 + 0x5 + 1x6 + 1x7 ≥ 25 } Thurs.
1x1 + 1x2 + 1x3 + 1x4 + 0x5 + 0x6 + 1x7 ≥ 21 } Friday
1x1 + 1x2 + 1x3 + 1x4 + 1x5 + 0x6 + 0x7 ≥ 19 } Saturday
 Nonnegativity & integrality conditions
xi >= 0 and integer for all i
13
Relaxation
 Original ILP
Max: 2x1 + 3x2
S.T.: x1 + 3x2 ≤ 8.25
2.5x1 + x2 ≤ 8.75
x1 , 2 ≥ 0
x1, x2 must be integers
 LP Relaxation
Max: 2x1 + 3x2
S.T.: x1 + 3x2 ≤ 8.25
2.5x1 + x2 ≤ 8.75
x1 , x2 ≥ 0
When solving an LP relaxation, sometimes you “get lucky”
and obtain an integer feasible solution. 14
Integer feasible vs. LP feasible region
x2

Integer Feasible Solutions

0
0 1 2 3 4 x1
1515
Bounds
 The optimal solution to an LP relaxation of an ILP
problem gives us a bound on the optimal
objective function value.
 For maximization problems, the optimal relaxed
objective function values is an upper bound on
the optimal integer value.
 For minimization problems, the optimal relaxed
objective function values is a lower bound on the
optimal integer value.

16
Rounding
 It is tempting to simply round a fractional
solution to the closest integer solution.
 In general, this does not work reliably:
 The rounded solution may be infeasible.
 The rounded solution may be suboptimal.

17
How rounding down can result in an
infeasible solution
x2

2
optimal relaxed solution

0
0 1 2 3 4 x1

18
Solving IP: Branch-and-bound algorithm
 Branching: among the remaining sub-
problems, select the one that was created
most recently.
 Bounding: for each new sub-problem, obtain
its bound by solving its LP relaxation problem.
 Testing/fathoming: apply the three tests
(Bound worse, Infeasible, Integral), and
terminate branching that are fathomed by any
of the tests.
 Stopping: when there are no remaining sub-
problems
19
The branch-and-bound example
Max: 2x1 + 3x2
S.T. x1 + 3x2 ≤ 8.25
2.5x1 + x2 ≤ 8.75
x1, x2 ≥ 0 and integer

20
Solution to LP relaxation
x2 3 Feasible Integer Solutions

Optimal Relaxed Solution


x1 = 2.769, x2 =1.826
2
Obj = 11.019

0
0 1 2 3 4 x1
21
Solution to LP relaxation

Solution to LP relaxation

22
The branch-and-bound algorithm

Solution to LP relaxation

Infeasible 23
Branch-and-bound summary
Max: 2x1 + 3x2
S.T. x1 + 3x2 ≤ 8.25
2.5x1 + x2 ≤ 8.75 Original Problem
x1=2.769
x1, x2 ≥ 0 and integer x2=1.826
Obj = 11.019 x1 ≥ 3
x1 ≤ 2
Problem II
Problem I
x1=2 x1=3
x2=2.083 x2=1.25
Obj = 10.25 Obj = 9.75

x2 ≤ 2 x2 ≥ 3

Problem III Problem IV


x1=2
x2=2 infeasible
Obj = 10
24
Branch-and-bound
 The Branch-and-Bound (B&B) algorithm can be used to
solve ILP problems.
 Requires the solution of a series of LP problems
termed “candidate problems”.
 Theoretically, this can solve any ILP.
 Practically, it often takes LOTS of computational effort
(and time).

25
Stopping rules
 Because B&B take so long, most ILP packages allow you
to specify a sub optimality tolerance factor.
 This allows you to stop once an integer solution is found
that is within some % of the global optimal solution.
 Bounds obtained from LP relaxations are helpful here.
 Example
o LP relaxation has an optimal obj. value of $64,306.
o 95% of $64,306 is $61,090.
o Thus, an integer solution with obj. value of $61,090 or better
must be within 5% of the optimal solution.

26
ILP with solver
In large ILP problems, there may be thousands of branches for exploration.
Solver has to solve thousands of LP problems and this can be very time
consuming. We can curtail this by selecting appropriate options.

Enter everything and click


on the Options.

27
ILP with solver
Selecting appropriate values, we can
terminate the program earlier and
accept the best result obtained up to
the termination time. This may or
may not be optimal.

28
Set partitioning algorithm

29
Set partitioning algorithm
Model:

30
Set covering algorithm

31
Set packing algorithm

32
Implementation – set partitioning algorithm
Route generation
Route Port served by ship Route Time Fixed Cost Fuel Cost Port Cost CO2 Cost Route Cost
Route
Index 2 3 4 5 6 7 (hr) (USD) (USD) (USD) (USD) (USD)
1 1-2-1 1 0 0 0 0 0 69.60 10,434.93 15,139.68 4,600.00 477.35 30,651.96
1 1-3-1 0 1 0 0 0 0 81.49 10,434.93 21,505.67 4,600.00 695.87 37,236.46
1 1-4-1 0 0 1 0 0 0 67.20 10,434.93 13,854.24 4,600.00 433.22 29,322.39
1 1-5-1 0 0 0 1 0 0 103.43 10,434.93 33,258.26 4,600.00 1,099.29 49,392.48
1 1-6-1 0 0 0 0 1 0 118.06 10,434.93 41,093.32 4,600.00 1,368.24 57,496.49
1 1-7-1 0 0 0 0 0 1 100.34 10,434.93 31,605.56 4,600.00 1,042.56 47,683.04
1 1-2-3-1 1 1 0 0 0 0 118.17 10,434.93 29,252.22 6,900.00 969.21 47,556.36
1 1-2-4-1 1 0 1 0 0 0 112.17 10,434.93 26,038.62 6,900.00 1,260.03 44,633.58
1 1-2-5-1 1 0 0 1 0 0 143.83 10,434.93 42,994.20 6,900.00 1,842.05 62,171.18
1 1-2-6-1 1 0 0 0 1 0 151.60 10,434.93 47,156.56 6,900.00 1,984.93 66,476.42
Single 1 1-2-7-1 1 0 0 0 0 1 150.46 10,434.93 46,544.42 6,900.00 1,963.92 65,843.27
1 1-3-4-1 0 1 1 0 0 0 109.49 10,434.93 24,600.15 6,900.00 1,210.65 43,145.73
routes 1 1-3-5-1 0 1 0 1 0 0 141.60 10,434.93 41,800.56 6,900.00 1,801.08 60,936.57
1 1-3-6-1 0 1 0 0 1 0 151.49 10,434.93 47,095.34 6,900.00 1,581.70 66,011.97
1 1-3-7-1 0 1 0 0 0 1 149.14 10,434.93 45,840.54 6,900.00 1,939.75 65,115.22
1 1-4-5-1 0 0 1 1 0 0 128.34 10,434.93 34,700.06 6,900.00 1,557.34 53,592.33
1 1-4-6-1 0 0 1 0 1 0 138.23 10,434.93 39,994.84 6,900.00 1,739.09 59,068.86
1 1-4-7-1 0 0 1 0 0 1 138.91 10,434.93 40,362.10 6,900.00 1,751.70 59,448.73
1 1-5-6-1 0 0 0 1 1 0 152.00 10,434.93 47,370.80 6,900.00 1,992.28 66,698.01
1 1-5-7-1 0 0 0 1 0 1 136.63 10,434.93 39,137.88 6,900.00 1,709.68 58,182.49
1 1-6-7-1 0 0 0 0 1 1 151.83 10,434.93 47,279.00 6,900.00 1,989.13 66,603.06
1 1-2-3-4-1 1 1 1 0 0 0 146.17 10,434.93 32,346.68 9,200.00 1,885.12 53,866.73
1 1-4-5-7-1 0 0 1 1 0 1 161.54 10,434.93 40,579.66 9,200.00 1,365.47 61,580.06
Multiple 2 1-2-1-3-1 1 1 0 0 0 0 151.09 10,434.93 34,978.79 9,200.00 1,975.47 56,589.19
2 1-2-1-4-1 1 0 1 0 0 0 136.80 10,434.93 27,327.36 9,200.00 1,712.83 48,675.12
routes 2 1-3-1-4-1 0 1 1 0 0 0 148.69 10,434.93 33,693.35 9,200.00 1,931.35 55,259.63
2 1-4-1-7-1 0 0 1 0 0 1 167.54 10,434.93 43,793.24 9,200.00 2,278.04 65,706.21
33
Implementation – set partitioning algorithm
Route selection
Route Port served by ship Route Time Fixed Cost Fuel Cost Port Cost CO2 Cost Route Cost Routes
Route Xij
Index 2 3 4 5 6 7 (hr) (USD) (USD) (USD) (USD) (USD) selection
1 1-2-1 1 0 0 0 0 0 69.60 10,434.93 15,139.68 4,600.00 477.35 30,651.96 1 30,651.96
1 1-3-1 0 1 0 0 0 0 81.49 10,434.93 21,505.67 4,600.00 695.87 37,236.46 0 -
1 1-4-1 0 0 1 0 0 0 67.20 10,434.93 13,854.24 4,600.00 433.22 29,322.39 0 -
1 1-5-1 0 0 0 1 0 0 103.43 10,434.93 33,258.26 4,600.00 1,099.29 49,392.48 0 -
1 1-6-1 0 0 0 0 1 0 118.06 10,434.93 41,093.32 4,600.00 1,368.24 57,496.49 0 -
1 1-7-1 0 0 0 0 0 1 100.34 10,434.93 31,605.56 4,600.00 1,042.56 47,683.04 0 -
1 1-2-3-1 1 1 0 0 0 0 118.17 10,434.93 29,252.22 6,900.00 969.21 47,556.36 0 -
1 1-2-4-1 1 0 1 0 0 0 112.17 10,434.93 26,038.62 6,900.00 1,260.03 44,633.58 0 -
1 1-2-5-1 1 0 0 1 0 0 143.83 10,434.93 42,994.20 6,900.00 1,842.05 62,171.18 0 -
1 1-2-6-1 1 0 0 0 1 0 151.60 10,434.93 47,156.56 6,900.00 1,984.93 66,476.42 0 -
1 1-2-7-1 1 0 0 0 0 1 150.46 10,434.93 46,544.42 6,900.00 1,963.92 65,843.27 0 -
1 1-3-4-1 0 1 1 0 0 0 109.49 10,434.93 24,600.15 6,900.00 1,210.65 43,145.73 0 -
1 1-3-5-1 0 1 0 1 0 0 141.60 10,434.93 41,800.56 6,900.00 1,801.08 60,936.57 0 -
1 1-3-6-1 0 1 0 0 1 0 151.49 10,434.93 47,095.34 6,900.00 1,581.70 66,011.97 1 66,011.97
1 1-3-7-1 0 1 0 0 0 1 149.14 10,434.93 45,840.54 6,900.00 1,939.75 65,115.22 0 -
1 1-4-5-1 0 0 1 1 0 0 128.34 10,434.93 34,700.06 6,900.00 1,557.34 53,592.33 0 -
1 1-4-6-1 0 0 1 0 1 0 138.23 10,434.93 39,994.84 6,900.00 1,739.09 59,068.86 0 -
1 1-4-7-1 0 0 1 0 0 1 138.91 10,434.93 40,362.10 6,900.00 1,751.70 59,448.73 0 -
1 1-5-6-1 0 0 0 1 1 0 152.00 10,434.93 47,370.80 6,900.00 1,992.28 66,698.01 0 -
1 1-5-7-1 0 0 0 1 0 1 136.63 10,434.93 39,137.88 6,900.00 1,709.68 58,182.49 0 -
1 1-6-7-1 0 0 0 0 1 1 151.83 10,434.93 47,279.00 6,900.00 1,989.13 66,603.06 0 -
1 1-2-3-4-1 1 1 1 0 0 0 146.17 10,434.93 32,346.68 9,200.00 1,885.12 53,866.73 0 -
1 1-4-5-7-1 0 0 1 1 0 1 161.54 10,434.93 40,579.66 9,200.00 1,365.47 61,580.06 1 61,580.06
2 1-2-1-3-1 1 1 0 0 0 0 151.09 10,434.93 34,978.79 9,200.00 1,975.47 56,589.19 0 -
2 1-2-1-4-1 1 0 1 0 0 0 136.80 10,434.93 27,327.36 9,200.00 1,712.83 48,675.12 0 -
2 1-3-1-4-1 0 1 1 0 0 0 148.69 10,434.93 33,693.35 9,200.00 1,931.35 55,259.63 0 -
2 1-4-1-7-1 0 0 1 0 0 1 167.54 10,434.93 43,793.24 9,200.00 2,278.04 65,706.21 0 -
TOTAL 3 158,243.98

34
Set covering problem
Given m sets and n items:
1, if set j includes item i
Aij   Columns = sets
0, otherwise
ci  cost of set j Rows = items
1, if set j is included
xj  
0, otherwise
n
Minimize c
j 1
j xj

s.t.
n

a
j 1
i, j x j  1, i  1..n

x j  0,1 , j  1..n 35
Example of Set covering problem
Nine districts (D1, D2,.., D9 D1
D9) are to be covered * *
within acceptable time
limits by emergency D2
vehicles. *

Seven potential sites S2


(S1, S2, …, S7) D8 
* S1
have been identified.  D3
S7 S3 *
 
Each site can reach only
some districts within the
S6 S4
time limit. D7 D4
 S5 
* *
We need to cover all 
districts with minimum D6 D5
number of sites. * *
36
Set covering problem
Nine districts (D1, D2, , D9) are to be covered within acceptable time limits by
emergency vehicles. Seven sites (S1, S2, …, S7) have been identified. Each site can
reach only some districts within the time limit. We need to cover all districts with
minimum number of sites.

S1 S2 S3 S4 S5 S6 S7
D1 0 1 0 1 0 0 1
D2 1 0 0 0 0 1 1
D3 0 1 0 0 0 1 1 What do 0 and 1
D4 0 1 1 0 1 1 0 in the table
indicate?
D5 1 0 1 0 1 0 0
D6 1 0 0 1 0 1 0
D7 1 0 0 0 0 0 1
D8 0 0 1 1 1 0 0
D9 1 0 0 0 1 0 0

37
Set covering formulation

Set Covering

Decisions Site S1 S2 S3 S4 S5 S6 S7

Objectives Sites 1 1 1 1 1 1 1 0

Constraints Coverage Min Req


D1 0 1 0 1 0 0 1 0 >= 1
D2 1 0 0 0 0 1 1 0 >= 1
D3 0 1 0 0 0 1 1 0 >= 1
D4 0 1 1 0 1 1 0 0 >= 1
D5 1 0 1 0 1 0 0 0 >= 1
D6 1 0 0 1 0 1 0 0 >= 1
D7 1 0 0 0 0 0 1 0 >= 1
D8 0 0 1 1 1 0 0 0 >= 1
D9 1 0 0 0 1 0 0 0 >= 1 38
Set covering solution
There may be alternate optimum solutions.

Set Covering

Decisions Site S1 S2 S3 S4 S5 S6 S7
0 0 0 1 1 0 1

Objectives Sites 1 1 1 1 1 1 1 3

Constraints Coverage Min Req


D1 0 1 0 1 0 0 1 2 >= 1
D2 1 0 0 0 0 1 1 1 >= 1
D3 0 1 0 0 0 1 1 1 >= 1
D4 0 1 1 0 1 1 0 1 >= 1
D5 1 0 1 0 1 0 0 1 >= 1
D6 1 0 0 1 0 1 0 1 >= 1
D7 1 0 0 0 0 0 1 1 >= 1
D8 0 0 1 1 1 0 0 2 >= 1
D9 1 0 0 0 1 0 0 1 >= 1
39
Set packing problem
The Happy Landings Motel has been a successful one-of-a-kind business
in its original location. Its new owner has decided to replicate the motel at
several locations and form a small chain. More expansion will follow if this
first phase is a success.

The new owner has identified nine potential locations where a motel
might be located. However, some of these locations are within 30 miles of
each other, and the owner prefers to separate motels in the chain by at
least 30 miles to avoid cannibalizing demand. The following information
about location conflicts has been obtained from a map

The new owner wants to build


motels on as many sites as
possible, while adhering to the
30-mile requirement.
40
Set packing problem

The new owner wants to build motels on as many


sites as possible, while adhering to the 30-mile
requirement. 41
References
 Wayne Winston, Operations Research:
Application and Algorithms, Duxbury Press.

42

You might also like