ht find a path through the augmentation graph through which a flow of 30 can be added. It might, however, find the path through which only a flow of 2 can be added. How bad might the running time be when the computation is unlucky enough to always take the worst legal step allowed by the algorithm? Start by taking the step that increases the flow by 2 for the input given in Figure 15.2. Then continue to take the worst possible step. You could draw out each and every step, but it is better to use this opportunity to use loop invariants. What does the flow look like after i iterations? Repeat this process on the same graph except that the four edges forming the square now have capacities 1,000,000,000,000,000 and the crossover edge has capacity 1. (Also move t to c or give that last edge a large capacity.)
3 In hill-climbing algorithms there are steps that make lots of progress
and steps that make very little progress. For example, the first iteration on the input
given in Figure 15.2 might find a path through the augmentation graph through which
a flow of 30 can be added. It might, however, find the path through which only a flow of
2 can be added. How bad might the running time be when the computation is unlucky
enough to always take the worst legal step allowed by the
step that increases the flow by 2 for the input given in Figure 15.2. Then continue to take
the worst possible step. You could draw out each and every step, but it is better to use
this opportunity to use loop invariants. What does the flow look like after i iterations?
Repeat this process on the same graph except that the four edges forming the square
now have capacities 1,000,000,000,000,000 and the crossover edge has capacity 1. (Also
move t to c or give that last edge a large capacity.)
1. What is the worst case number of iterations of this network flow algorithm as a
function of the number of edges m in the input network?
2. What is the official “size” of a network?
3. What is the worst case number of iterations of this network flow algorithm as a
function of the size of the input network?
Step by step
Solved in 2 steps