APPM 4120/5120 Exam #2 Practice Solutions Spring 2015

Transcription

APPM 4120/5120 Exam #2 Practice Solutions Spring 2015
APPM 4120/5120
Exam #2 Practice Solutions
Spring 2015
You are not allowed to use textbooks, class notes.
Problem #1 (20 points): Consider the following activity-on-arc project network, where the 12 arcs
(arrows) represent the 12 activities (tasks) that must be performed to complete the project and the
network displays the order in which the activities need to be performed. The number next to each arc
(arrow) is the time required for the corresponding activity. Consider the problem of finding the
longest path (the largest total time) through this network from start (node 1) to finish (node 9), since
the longest path is the critical path. Formulate a BIP model for this problem.
Figure 1: Network for Problem 1
Solution: Let x i j be defined as usual. The time required for activity (i, j) will become the coefficient of
x i , j in the objective function being maximized in the BIP model. The model also will need some
functional constraints to ensure that a feasible solution defines one continuous path from node 1 to
node 9. In particular, the critical path needs to include exactly one activity leading out of node 1 and
exactly one activity leading into node 9. Similarly, for each of the other nodes, the critical path needs
to include either zero or one activity leading into that node and the same number of activities leading
out of that node. These observations lead to the following BIP model.
Maximize Z = 5x 12 + 3x 13 + 4x 24 + 2x 25 + 3x 35 + x 46 + 4x 47
+ 6x 57 + 2x 58 + 5x 69 + 4x 79 + 7x 89
subject to
x 12 + x 13 = 1
x 12 − x 24 − x 25 = 0
x 13 − x 35 = 0
x 24 − x 46 − x 47 = 0
x 25 + x 35 − x 57 − x 58 = 0
x 46 − x 69 = 0
x 47 + x 57 − x 79 = 0
x 58 − x 89 = 0
x 69 + x 79 + x 89 = 1
1
and x i j is binary, for each activity (i, j).
Problem #2 (10 points): Decora Accessories manufactures a variety of bathroom accessories,
including decorative towel rods and shower curtain rods. Each of the accessories includes a rod made
out of stainless steel. However, many different lengths are needed: 12", 18", 24", 40", and 60". Decora
purchases 60" rods from an outside supplier and then cuts the rods as needed for their products. Each
60" rod can be used to make a number of smaller rods. For example, a 60" rod could be used to make a
40" and an 18" rod (with 2" of waste), or 5 12" rods (with no waste). For the next production period,
Decora needs 25 12" rods, 52 18" rods, 45 24" rods, 30 40" rods, and 12 60" rods. What is the fewest
number of 60? rods that can be purchased to meet their production needs? Formulate an integer
programming model in algebraic form for this problem.
Solution: The first step is to determine all the different ways of cutting up a 60" rod into the rods of
the desired lengths. The following table shows the 11 different patterns for doing this, where the
numbers in the table give the number of cut rods of the indicated length that are included in the
pattern. The decisions to be made are how many rods should be cut into each of the possible patterns,
Length of Cut Rod
12
18
24
40
60
1
5
2
3
1
3
3
4
2
2
1
5
1
1
1
6
1
7
1
8
9
10
3
2
1
1
2
1
11
1
1
Table 1: Parameter Table
so let
x j = number of rods to be cut into pattern j , j = 1, 2, . . . , 11.
We want to minimize the number of 60" rods that are needed to fulfill the minimum requirements for
providing the number of cut rods of the various lengths. Therefore, the desired model is
Min Z =
11
X
xj.
j =1
subject to
5x 1 + 3x 2 + 3x 3 + 2x 4 + x 5 + x 6 + x 7 ≥ 25
3x 2 + 2x 4 + x 5 + 3x 8 + 2x 9 ≥ 52
3x 3 + x 5 + 2x 6 + x 9 ≥ 45
x 7 + x 10 ≥ 30
x 11 ≥ 12
x j ≥ 0 and integer ∀ j
Problem #3 (10 points): Suppose you are given a graph G = (V, E ) with edge weights w(e) and a
minimum spanning tree T of G. Now, suppose a new edge {u, v} is added to G. Describe (in words) a
method for determining if T is still a minimum spanning tree for G.
2
Solution: Examine the path in T from u to v. If any vertex on this path has weight larger than that of
the new edge, then T is no longer an MST. We can modify T to obtain a new MST by removing the max
weight edge on this path and replacing it with the new edge.
Problem #4 (20 points): The residual graph shown below is for some flow f on a flow graph G.
Figure 2: Network for Problem 4
(a) What is the capacity of the edge connecting e and c in G? Justify your answer.
(b) Is the edge in G directed from c to e or from e to c. Justify your answer. (Hint: consider the total
incoming flow at e.) You may assume that there is no more than one edge joining any two
vertices, but you should not assume anything about the direction of the edges at s and t (that is,
G may have edges entering s or leaving t).
(c) Find a shortest augmenting path relative to f. Draw the residual graph that results from adding
as much flow as possible to this path.
Solution:
(a) This edge has capacity 7 in the residual graph because the sum of the residual capacities in
opposite directions is equal to the original capacity.
(b) Consider vertex e. Since this is not the source or the sink, it must satisfy flow conservation. For
each or its three incident edges, there are two possible flow values entering e. For the be edge,
the inflow is either 0 or 5. For the et edge, the inflow is either 0 or -3. For the ce edge, the inflow
is either 3 or -4. Since the sum of the inflows must be 0, the inflow on the be edge must be 0, the
inflow on the et edge must be -3 and the inflow on the ce edge must be 3. This implies that the
edge is directed from c to e.
(c) The path is sad t and the new residual graph appears below.
Problem #5 (20 points): The Build-Em-Fast Company has agreed to supply its best customer with
three widgits during each of the next 3 weeks, even though producing them will require some
overtime work. The relevant production data are as follows:
The cost per unit produced with overtime for each week is $100 more than for regular time. The cost
of storage is $50 per unit for each week it is stored. There is already an inventory of two widgets on
hand currently, but the company does not want to retain any widgets in inventory after the 3 weeks.
Management wants to know how many units should be produced in each week to minimize the total
3
Figure 3: Network for Problem 4
Week
1
2
3
Max Production/Regular Time
2
3
1
Max Production/Overtime
2
2
2
Cost per Unit/Regular
$300
$500
$400
Table 2: Data
cost of meeting the delivery schedule. Formulate this problem as a transportation problem by
constructing the appropriate parameter table.
Solution: Define the sources and destinations as:
(a) Source 1: the supply of initial inventory
(b) Source 2: the supply of production from regular hours in week 1
(c) Source 3: the supply of production from overtime in week 1
(d) Source 4: the supply of production from regular hours in week 2
(e) Source 5: the supply of production from overtime in week 2
(f) Source 6: the supply of production from regular hours in week 3
(g) Source 7: the supply of production from overtime in week 3
(h) Destination 1: the demand in week 1
(i) Destination 2: the demand in week 2
(j) Destination 3: the demand in week 3
(k) Destination 4: a dummy destination
The parameter table is given below:
Problem #6 (20 points): Consider an assignment problem with four workers, A, B, C, and D, and three
jobs, 1, 2, and 3:
(a) Put into standard form for the Hungarian Method, increasing or decreasing costs and creating
dummy workers or dummy jobs as necessary. (For ease of grading, please do your costs
increases or decreases before creating dummy workers or jobs.) Explain why your cost increases
or decreases don’t distort the optimal assignment of workers to jobs. Explain why your
assignment of costs to dummy workers or jobs doesn’t distort the optimal assignment of real
workers to real jobs.
4
Shipping cost
1
2
3
4
5
6
7
Demand
1
0
300
400
M
M
M
M
3
2
50
350
450
500
600
M
M
3
3
100
400
500
550
650
400
500
3
4(dummy)
0
0
0
0
0
0
0
5
Supply
2
2
2
3
2
1
2
Table 3: Parameter Table
A
B
C
D
1
4
3
9
7
2
6
-1
2
6
3
5
7
8
9
Table 4: Data for problem 6
(b) Can you solve this using the Hungarian algorithm? Why to why not? Explain why row and
column reduction don’t distort the optimal assignment of workers to jobs. If it is solvable, solve
it.
Solution:
(a) There are two problems with the problem: one cost is < 0, and there are more workers than jobs.
First add one to all costs, making them all nonnegative. Then create a dummy job with all costs
0, to finish putting the problem into standard form,
A
B
C
D
1
5
4
10
8
2
7
0
3
7
3
6
8
9
10
4
0
0
0
0
Table 5: Data for problem 6
(b) Row reduction doesn’t change the problem at all in this case, because there are 0s in all entries in
the fourth column. It wouldn?t distort the optimal assignment anyway because all people must
be assigned, and so it is like subtracting a constant from the cost of all assignments. Column
reduction doesn?t distort the optimal assignment for the same reason. So yes it can be solved.
5