Chap 6
Chap 6
(Integer Programming)
Issues to be discussed:
1. Various applications of Integer Programming (IP)
-- focus on IP problems with binary variables: 1-0, for “Yes-No”.
2
Linear Programming (LP)
vs. Integer Programming (IP)
3
Example 6.1 Capital Budgeting
The Tatham Company is considering 7 investments. The cash
required for each investment and the net present value (NPV)
each investment adds to the firm are given below.
Cash NPV Added
Required
Investment 1 $5,000 $16,000
Investment 2 $2,500 $8,000
Investment 3 $3,500 $10,000
Investment 4 $6,000 $20,000
Investment 5 $7,000 $22,000
Investment 6 $4,500 $12,000
Investment 7 $3,000 $8,000
4
Background Information
The cash available for investment is $15,000.
If Tatham wishes to take part in any of these
investments, it must go “all the way”. i.e., it cannot, for
example, go halfway in investment 1 by investing
$2500 and realizing an NPV of $8000.
5
Formulation and The Solver
We use a 0-1 variable for each investment. If a particular
investment is chosen, the variable for this investment will equal
1; if not, the variable will equal 0.
Using the Solver:
6
Optimal Solution
There is more than one optimal solution.
If we rank Tatham’s investments on the basis of NPV per
dollar invested, the ranking from best to worst is 4, 1, 2, 5, 3,
6, 7.
7
Some Modifications to the problem:
At most two investments can be selected.
If investment 2 is selected, 1 must also be selected.
Suppose that either investment 1 or investment 3 (or both) must
be selected.
8
Fixed Cost Model
9
Example 6.2 Great Threads’ Problem
The Great Threads Company is capable of manufacturing shirts,
shorts, pants, Skirts, and Jackets.
Each type of clothing requires that Great Threads have the
appropriate type of machinery available.
The machinery needed must be rented at the weekly rates shown
in the table. There are 4000 labor hours and 4500 square yards
of cloth available in a given week.
The company wants to maximize its weekly profit.
10
Background
Information
Machine Labor Hours Cloth(Sq yd) Sales Unit Variable
Rental Cost Price Cost
11
Developing the Model
We model the fixed cost constraint with a logical upper bound as
follows:
12
Formulation
We need to keep track of the following:
– 0-1 variable for each type of clothing that indicates whether any of
that type of clothing is produced
– Total profit, which equals revenue from sales minus the cost of
renting machines minus the variable cost of producing clothing
13
“Either-Or” Constraints
14
Ex 6.3 Dorian Auto’s Problem
Dorian Auto is considering manufacturing five types of cars –
compact, midsize, large, mid-size minivan, and large minivan.
The resources required and the profits yielded by each type of
car are shown below.
At present, 6500 tons of steel and 65,000 hours of labor are
available.
If any cars of a given type are produced, production of that type
of car will be economically feasible only if at least a minimum
number of that type are produced.
Dorian wants to maximize its profit.
15
Ex 6.3
Compact Midsize Large Mid Size Large
Minivan Minivan
16
Formulation
The model for this example must keep track of the following:
– Introducing logical lower bound and logical upper bound for production
quantities
17
Optimal Solution
The optimal solution indicates that Dorian should not produce
any midsize or large cars.
Obviously, Midsize car is not as profitable as midsize minivan,
and large size car is not as profitable as large size minivan.
18
Ex 6.3 (continue)
Suppose that compact and midsize cars are mutually
exclusive; similarly, mid-size minivan and large
minivan are mutually exclusive. What is the optimal
production plan?
19
Ex 6.3 (continue)
Suppose there are two production lines for compact
car: with Line-1, any number between 0 and 200 is
feasible, and with Line-2, at least 1000 need to be
produced. How to model the problem?
20
Set-Covering Problem
Each member of Set 1 can cover (provide service to) some
members of Set 2;
Objective: find a smallest number of members of Set 1 to cover
all members of Set 2.
21
Example 6.4 MBA-MSc Fairs
The HKUST Business School is planning to hold MBA/MSc Fairs in mainland China and is targeting 22 major cities
(population centers).
One way to gauge the effectiveness of a particular MBA/MSc Fair is to see how many cities are within a certain
distance, say 300 kilometers, of this fair. The school will not be able to hold a fair in every city, but wants to hold enough
fairs so that each city is covered, i.e., within 300 kilometers of at least one of the fairs.
a) What is the minimum number of fairs that need to be held? In which ones of the 22 cities?
b) If the school can only afford 7 fairs. Where should they be held (so that the population covered is maximized)?
22
Example 6.4 MBA-MSc Fairs
Population (million, estimate)
Beijing Tianjin Shanghai Chongqing Harbin Changchun Shenyang Shijiazhuang Zhengzhou Jinan Taiyuan Lanzhou Xian Chengdu Wuhan Hangzhou Fuzhou Nanchang Changsha Guiyang Kunming Guangzhou
12.46 9.80 14.01 25.97 9.92 7.57 7.17 9.77 7.32 6.03 3.65 3.24 7.82 11.40 8.36 6.83 6.38 4.97 6.52 3.67 5.34 7.95
Distances (km)
Beijing Tianjin Shanghai Chongqing Harbin Changchun Shenyang Shijiazhuang Zhengzhou Jinan Taiyuan Lanzhou Xian Chengdu Wuhan Hangzhou Fuzhou Nanchang Changsha Guiyang Kunming Guangzhou
Beijing 0 125 1239 3026 1230 979 684 292 695 421 506 1622 1092 1881 1171 1322 1981 1458 1516 2318 2907 2179
Tianjin 125 0 1150 1954 1207 955 661 308 711 332 523 1626 1107 1897 1187 1240 1891 1406 1576 2364 2923 2197
Shanghai 1239 1150 0 1945 2342 2090 1796 1118 943 839 1327 2006 1381 2181 908 178 836 775 1049 1910 2529 1539
Chongqing 3006 1954 1945 0 3156 2905 2610 1650 1326 1799 1450 1275 847 356 1078 1897 1962 1400 1500 384 973 1710
Harbin 1230 1207 2342 3156 0 256 546 1510 1914 1524 1725 2849 2309 3099 2389 2425 3083 2591 2700 3537 4126 3383
Changchun 979 955 2090 2905 256 0 294 1259 1662 1272 1473 2598 2057 2847 2137 2173 2831 2341 2433 3285 3874 3133
Shenyang 684 661 1796 2610 546 294 0 964 1368 978 1179 2303 1763 2547 1827 1800 2533 2045 2132 1987 3572 2832
Shijiazhuang 292 308 1118 1650 1510 1259 964 0 418 300 218 1321 802 1593 955 1200 1859 1278 1240 2030 2611 1902
Zhengzhou 695 711 943 1326 1914 1662 1368 418 0 495 437 1103 478 1278 569 941 1452 961 853 1544 2100 1516
Jinan 421 332 839 1799 1524 1272 978 300 495 0 509 1612 951 1751 919 929 1580 1095 1209 1934 2514 1887
Taiyuan 506 523 1327 1450 1725 1473 1179 218 437 509 0 1121 602 1392 997 1370 1882 1389 1281 1862 2419 1944
Lanzhou 1622 1626 2006 1275 2849 2598 2303 1321 1103 1612 1121 0 624 1058 1446 2005 2332 1835 1727 1754 1938 2393
Xian 1092 1107 1381 847 2309 2057 1763 802 478 951 602 624 0 798 813 1379 1699 1205 1097 2885 3475 1760
Chengdu 1881 1897 2181 356 3099 2847 2547 1593 1278 1751 1392 1058 798 0 1455 2179 2341 1844 1801 736 917 2047
Wuhan 1171 1187 908 1078 2389 2137 1827 955 569 919 997 1446 813 1455 0 860 924 434 361 1278 1834 1021
Hangzhou 1322 1240 178 1897 2425 2173 1800 1200 941 929 1370 2005 1379 2179 860 0 688 562 971 1763 2343 1352
Fuzhou 1981 1891 836 1962 3083 2831 2533 1859 1452 1580 1882 2332 1699 2341 924 688 0 582 967 1756 2478 901
Nanchang 1458 1406 775 1400 2591 2341 2045 1278 961 1095 1389 1835 1205 1844 434 562 582 0 453 1242 1822 835
Changsha 1516 1576 1049 1500 2700 2433 2132 1240 853 1209 1281 1727 1097 1801 361 971 967 453 0 1105 2626 734
Guiyang 2318 2364 1910 384 3537 3285 1987 2030 1544 1934 1862 1754 2885 736 1278 1763 1756 1242 1105 0 588 470
Kunming 2907 2923 2529 973 4126 3874 3572 2611 2100 2514 2419 1938 3475 917 1834 2343 2478 1822 2626 588 0 1585
Guangzhou 2179 2197 1539 1710 3383 3133 2832 1902 1516 1887 1944 2393 1760 2047 1021 1352 901 835 734 470 1585 0
23
Solution
a) What is the minimum number of fairs that need to be held? In which ones of the 22 cities?
- If a fair is held in city-A, which cities it can serve: represented by 1-0
b) If the school can only afford 7 fairs. Where should they be held?
- Choose 7 cities for fairs to maximize the targeted population.
24
Assignment Models
There are M workers, and N jobs.
– The cost (or time) of having worker i to do job j is cij.
How to assign workers to complete the jobs so that
the total cost is minimized
25
Set Covering problem vs. Assignment problem
26
Set-Covering Problem vs. Assignment Problem
Set-covering problem
Set 1 Set 2
(providing service) (receiving service)
28
Distances between cities
Boston Chicago Dallas Denver Los Angeles Miami New York Phoenix Pittsburgh
Los Angeles 3036 2112 1425 1174 0 2757 2825 398 2456
New York 213 840 1604 1780 2825 1258 0 2442 386
29
Numbers of annual trips to customers
Annual trips
Boston 885
Chicago 760
Dallas 1124
Denver 708
Los Angeles 1224
Miami 1152
New York 1560
Phoenix 1222
Pittsburgh 856
30
Ex. 6.5 (cont’d) – The Solution
The keys to this model are the binary decision variables and the
logical constraints.
– For each city a binary variable is used to indicate where a service center is
located. ----- Center or not Center in a city.
32
Example 6.6 Cutting Stock Problem (optional)
The Rheem Paper Company produces rolls of paper of various
types for its customers.
One type is produced in standard rolls that are 60 inches wide
and (when unwound) 200 yards long.
Demands for this type of paper are all rolls 200 yards long but
can have any of the widths 12, 15, 20, 24, 30, or 40 inches.
33
Background Information
In a given week, Rheem waits for all orders and then decides how
to cut its 60-inch rolls into narrower rolls to satisfy the orders.
E.g., if there are 5 orders for 15-inch widths and 2 orders for 40-
inch, Rheem could produce 3 rolls, cut two rolls into a (40-inch +
15-inch) cut, and cut the third roll into 4 15-inch cuts.
Each week Rheem must decide how to cut its rolls in the most
economical way to meet its orders.
Suppose the orders this week for widths 12, 15, 20, 24, 30, and
40 inches are 48, 19, 22, 32, 14, 7, respectively.
How to satisfy the demand?
34
Formulation
Given the width of the rolls (60 inches) and the available widths
(12,15, 20, 24, 30, and 40), the first thing we must do is to
“preprocess” the patterns that might be used.
The patterns we consider (“feasible” patterns) are the ones with
no leftover paper that could be used for customer orders.
There is no model for determining all of the feasible patterns. We
simply go through all of the possibilities in a systematic way.
Once we have listed all possible patterns, the problem is then to
decide how many rolls to cut into each pattern.
35
“Optimal” Solution
Rheem can meet its customer orders this week with 47 rolls.
For example, 12 of the 47 rolls should be cut according to
pattern 4, each with three 12-inch rolls and one 24 inch roll.
Note that there are two sources of “waste” in this solution.
– Unusable waste from all leftover rolls with width less than 12 inches.
– Usable rolls that are not needed in this week’s orders.
If Rheem solves this model on a weekly basis, the model could
easily incorporate usable leftover rolls from the previous week.
36
Solver Tolerance Setting
Until now we have suggested setting the Solver tolerance to 0%.
This guarantees the optimal solution. However, there is a good
reason why the default tolerance setting is 5%.
When we set the tolerance to 0%, the Solver quickly got to a
solution that requires 47 rolls, but then kept running.
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.
37
Solver Tolerance Setting
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: If you set the tolerance to a low value and find that
the Solver is taking forever, press Ctrl-Break or ESC to get out.
By that time, you probably already have a very good or even
optimal solution.
38
Assignment:
Exercise:
– 41, 49
– 66
– 52, 74, 86
39