Sei sulla pagina 1di 3

Solutions to Homework Seven

CSE 101

7.1. A two-dimensional LP.


y
(2,5)

5
4

optimal
(5,2)

3
2
1
0 1

7.2. Transporting duckwheat.


Let XKN be the amount of duckwheat sent from Kansas to New York; similarly define XKC , XM N , XM C .
min 4XM N + XM C + 2XKN + 3XKC
XKN + XKC

15

XM N + XM C
XKN + XM N

=
=

8
10

XKC + XM C
XKN , XKC , XM N , XM C

= 13
0

7.3. Cargo plane.


Let x1 denote the volume of Material 1, in cubic meters; similarly define x2 , x3 for Materials 2 and 3.
maximize 1000x1 + 1200x2 + 12000x3
2x1 + x2 + 3x3 100
x1 + x2 + x3 60
x1 40
x2 30
x3 20
x1 , x2 , x3 0
7.5. Canine products.
Let F denote the number of bags of Frisky Pup produced per month, and H the number of bags of
Husky Hound. The profit per bag of Frisky Pup is $7 ($1 + $3 + $1.40) = $1.60. The profit per bag
of Husky Hound is $6 ($2 + $2 + $0.60) = $1.40.

maximize 1.6F + 1.4H


F + 2H 240000
1.5F + H 180000
F 110000
F, H 0
1

The graph below shows multiples of 1000. The vertices (again in multiples of 1000) are (F, H) =
(0, 0), (0, 120), (60, 90), (110, 15), (110, 0). The maximum profit is $222,000.
H
180

optimal
(60,90)

120

60

60

120

180

240

7.10. The maximum flow is 13, and is shown below. The dotted line shows a cut of capacity 13.
4/4

4/5

G
6/6

0/2
9/12

5/10

1/1

0/1

2/2

5/20

0/6

2/2

6/10

4/4

4/5

7.17. The network below includes the max-flow and a matching min-cut.

4/4

C
6/9

6/7
2/2

S
2/2
5/6

5/5

3/3

(b) The residual graph Gf and its edge capacities. The vertices reachable from S are S, A, B. Vertex
T is reachable from C, T .
4

6
3

5
1

5
3

(c) The bottleneck edges are (A, C) and (B, C).


(d) A network with no bottleneck edges:

(e) An algorithm to identify all bottleneck edges in a network.


i. Run the Ford-Fulkerson algorithm, making sure on each iteration to pick the s t path with
the fewest edges (this can be done by BFS). Let f be the maximum flow returned.
ii. Construct the residual graph Gf .
iii. Run explore(Gf , s) to find the set of vertices A reachable from s.
R
iv. Construct the reverse graph GR
f (recall a previous homework) and run explore(Gf , t) to find
the set of vertices B from which t is reachable.
v. For each edge (u, w) E: if u A and w B then output (u, w).
Justification: The algorithm is based on the following principle:
Edge (u, w) is a bottleneck edge if and only if increasing its capacity would create a path
from s to t in Gf .
There are two cases to check: if increasing c(u, w) creates a path from s to t in Gf , then flow f
can be increased along that path, so the edge is a bottleneck. Conversely, if increasing c(u, w)
does not create a path from s to t, then f remains a max flow (the Ford Fulkerson algorithm
makes no further progress), and thus the edge is not a bottleneck.
In short: an edge is a bottleneck if and only if it leads from set A to set B.
Running time: This particular way of running the Ford-Fulkerson algorithm requires O(|V ||E|)
iterations, each taking O(|E|) time, a total of O(|V | |E|2 ). The subsequent steps are all linear.

Potrebbero piacerti anche