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.
Integrality conditions
Max: 350x1 + 300x2
S.T.: x1 + x2 <= 200
9x1 + 6x2 <= 1566
12x1 + 16x2 <= 2880
x1, x2>= 0
x1, x2 must be integers
} profit
} pumps
} labor
} tubing
} nonnegativity
} 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.
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.
6
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.
7
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
Defining the constraints
Capital constraints
75x1 + 90x2 + 60x3 + 30x4 + 100x5 + 50x6 250
25x1 + 35x2 + 15x3 + 20x4 + 25x5 + 20x6 75
20x1 + 0x2 + 15x3 + 10x4 + 20x5 + 10x6 50
15x1 + 0x2 + 15x3 + 5x4 + 20x5 + 30x6 50
10x1 + 30x2 + 15x3 + 5x4 + 20x5 + 40x6 50
} year 1
} year 2
} year 3
} year 4
} year 5
Binary constraints
All xi must be binary
9
Example: An employee scheduling problem
Day of Week
Sunday
Workers Needed
18
Shift
1
Days Off
Sun & Mon
Wage
$680
Monday
27
Mon & Tue
$705
Tuesday
22
Tue & Wed
$705
Wednesday
26
Wed & Thr
$705
Thursday
25
Thr & Fri
$705
Friday
21
Fri & Sat
$680
Saturday
19
Sat & Sun
$655
10
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
11
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
12
Relaxation
Original ILP
Max:
S.T.:
2x1 + 3x2
x1 + 3x2 8.25
2.5x1 + x2 8.75
x1 , 2 0
x1, x2 must be integers
LP Relaxation
Max:
S.T.:
2x1 + 3x2
x1 + 3x2 8.25
2.5x1 + x2 8.75
x1 , x 2 0
When solving an LP relaxation, sometimes you get lucky
and obtain an integer feasible solution.
13
Integer feasible vs. LP feasible region
x2
Integer Feasible Solutions
3
x1
1414
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.
15
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.
16
How rounding down can result in an
infeasible solution
x2
optimal relaxed solution
0
0
x1
17
Solving IP: Branch-and-bound algorithm
Branching: among the remaining subproblems, 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 subproblems
18
The branch-and-bound example
Max: 2x1 + 3x2
S.T.
x1 + 3x2 8.25
2.5x1 + x2 8.75
x1, x2 0 and integer
19
Solution to LP relaxation
x2 3
Feasible Integer Solutions
Optimal Relaxed Solution
x1 = 2.769, x2 =1.826
Obj = 11.019
0
0
x1
20
The branch-and-bound algorithm
Problem I Max:
S.T.
2x1 + 3x2
x1 + 3x2 8.25
2.5x1 + x2 8.75
x1 2
x1, x2 0 and integer
Problem II Max:
S.T.
2x1 + 3x2
x1 + 3x2 8.25
2.5x1 + x2 8.75
x1 3
x1, x2 0 and integer
21
Solution to LP relaxation
x2
3
Problem I
x1=2, x2=2.083, Obj = 10.25
Problem II
1
x1
22
The branch-and-bound algorithm
Problem III
Max:
2x1 + 3x2
S.T.
x1 + 3x2 8.25
2.5x1 + x2 8.75
x1 2
x2 2
x1, x2 0 and integer
Problem IV
Max:
2x1 + 3x2
S.T.
x1 + 3x2 8.25
2.5x1 + x2 8.75
x1 2
x2 3
x1, x2 0 and integer
23
Solution to LP relaxation
x2
3
Problem III
x1=2, x2=2, Obj = 10
Problem II
x1=3, x2=1.25, Obj = 9.75
0
0
x1
24
Branch-and-bound summary
Max:
2x1 + 3x2
S.T.
x1 + 3x2 8.25
2.5x1 + x2 8.75
x1, x2 0 and integer
x1 2
Original Problem
x1=2.769
x2=1.826
Obj = 11.019
x1 3
Problem II
Problem I
x1=2
x2=2.083
Obj = 10.25
x2 2
x1=3
x2=1.25
Obj = 9.75
x2 3
Problem III
x1=2
x2=2
Obj = 10
Problem IV
infeasible
25
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).
26
Stopping rules
Because B&B take 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
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.
o
27
Set partitioning algorithm
28
Set partitioning algorithm
Model:
29
Set covering algorithm
30
Set packing algorithm
31
Implementation set partitioning algorithm
Route generation
Route
Index
1
1
1
1
1
1
1
1
1
1
1
Single
1
routes 1
1
1
1
1
1
1
1
1
1
1
Multiple 2
2
routes 2
2
Route
1-2-1
1-3-1
1-4-1
1-5-1
1-6-1
1-7-1
1-2-3-1
1-2-4-1
1-2-5-1
1-2-6-1
1-2-7-1
1-3-4-1
1-3-5-1
1-3-6-1
1-3-7-1
1-4-5-1
1-4-6-1
1-4-7-1
1-5-6-1
1-5-7-1
1-6-7-1
1-2-3-4-1
1-4-5-7-1
1-2-1-3-1
1-2-1-4-1
1-3-1-4-1
1-4-1-7-1
2
1
0
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
1
1
0
0
Port served by ship
3
4
5
6
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
1
0
0
1
0
1
0
1
0
0
1
1
0
0
0
0
1
1
0
0
1
0
1
0
1
0
0
0
0
1
1
0
0
1
0
0
0
0
1
1
1
0
0
0
1
1
0
1
0
0
0
0
1
0
0
1
1
0
0
0
1
0
0
7
0
0
0
0
0
1
0
0
0
0
1
0
0
0
1
0
0
1
0
1
1
0
1
0
0
0
1
Route Time
(hr)
69.60
81.49
67.20
103.43
118.06
100.34
118.17
112.17
143.83
151.60
150.46
109.49
141.60
151.49
149.14
128.34
138.23
138.91
152.00
136.63
151.83
146.17
161.54
151.09
136.80
148.69
167.54
Fixed Cost
(USD)
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
Fuel Cost
(USD)
15,139.68
21,505.67
13,854.24
33,258.26
41,093.32
31,605.56
29,252.22
26,038.62
42,994.20
47,156.56
46,544.42
24,600.15
41,800.56
47,095.34
45,840.54
34,700.06
39,994.84
40,362.10
47,370.80
39,137.88
47,279.00
32,346.68
40,579.66
34,978.79
27,327.36
33,693.35
43,793.24
Port Cost
(USD)
4,600.00
4,600.00
4,600.00
4,600.00
4,600.00
4,600.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
9,200.00
9,200.00
9,200.00
9,200.00
9,200.00
9,200.00
CO2 Cost
(USD)
477.35
695.87
433.22
1,099.29
1,368.24
1,042.56
969.21
1,260.03
1,842.05
1,984.93
1,963.92
1,210.65
1,801.08
1,581.70
1,939.75
1,557.34
1,739.09
1,751.70
1,992.28
1,709.68
1,989.13
1,885.12
1,365.47
1,975.47
1,712.83
1,931.35
2,278.04
Route Cost
(USD)
30,651.96
37,236.46
29,322.39
49,392.48
57,496.49
47,683.04
47,556.36
44,633.58
62,171.18
66,476.42
65,843.27
43,145.73
60,936.57
66,011.97
65,115.22
53,592.33
59,068.86
59,448.73
66,698.01
58,182.49
66,603.06
53,866.73
61,580.06
56,589.19
48,675.12
55,259.63
65,706.21
32
Implementation set partitioning algorithm
Route selection
Route
Index
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
Route
1-2-1
1-3-1
1-4-1
1-5-1
1-6-1
1-7-1
1-2-3-1
1-2-4-1
1-2-5-1
1-2-6-1
1-2-7-1
1-3-4-1
1-3-5-1
1-3-6-1
1-3-7-1
1-4-5-1
1-4-6-1
1-4-7-1
1-5-6-1
1-5-7-1
1-6-7-1
1-2-3-4-1
1-4-5-7-1
1-2-1-3-1
1-2-1-4-1
1-3-1-4-1
1-4-1-7-1
2
1
0
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
1
1
0
0
Port served by ship
3
4
5
6
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
1
0
0
1
0
1
0
1
0
0
1
1
0
0
0
0
1
1
0
0
1
0
1
0
1
0
0
0
0
1
1
0
0
1
0
0
0
0
1
1
1
0
0
0
1
1
0
1
0
0
0
0
1
0
0
1
1
0
0
0
1
0
0
7
0
0
0
0
0
1
0
0
0
0
1
0
0
0
1
0
0
1
0
1
1
0
1
0
0
0
1
Route Time
(hr)
69.60
81.49
67.20
103.43
118.06
100.34
118.17
112.17
143.83
151.60
150.46
109.49
141.60
151.49
149.14
128.34
138.23
138.91
152.00
136.63
151.83
146.17
161.54
151.09
136.80
148.69
167.54
TOTAL
Fixed Cost
(USD)
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
10,434.93
Fuel Cost
(USD)
15,139.68
21,505.67
13,854.24
33,258.26
41,093.32
31,605.56
29,252.22
26,038.62
42,994.20
47,156.56
46,544.42
24,600.15
41,800.56
47,095.34
45,840.54
34,700.06
39,994.84
40,362.10
47,370.80
39,137.88
47,279.00
32,346.68
40,579.66
34,978.79
27,327.36
33,693.35
43,793.24
Port Cost
(USD)
4,600.00
4,600.00
4,600.00
4,600.00
4,600.00
4,600.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
6,900.00
9,200.00
9,200.00
9,200.00
9,200.00
9,200.00
9,200.00
CO2 Cost
(USD)
477.35
695.87
433.22
1,099.29
1,368.24
1,042.56
969.21
1,260.03
1,842.05
1,984.93
1,963.92
1,210.65
1,801.08
1,581.70
1,939.75
1,557.34
1,739.09
1,751.70
1,992.28
1,709.68
1,989.13
1,885.12
1,365.47
1,975.47
1,712.83
1,931.35
2,278.04
Route Cost
(USD)
30,651.96
37,236.46
29,322.39
49,392.48
57,496.49
47,683.04
47,556.36
44,633.58
62,171.18
66,476.42
65,843.27
43,145.73
60,936.57
66,011.97
65,115.22
53,592.33
59,068.86
59,448.73
66,698.01
58,182.49
66,603.06
53,866.73
61,580.06
56,589.19
48,675.12
55,259.63
65,706.21
Xij
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
0
0
0
3
Routes
selection
30,651.96
66,011.97
61,580.06
158,243.98
33
References
Wayne Winston, Operations Research:
Application and Algorithms, Duxbury Press.
34