Reference no: EM13550445
Take the code you wrote for the Ford-Fulkerson algorithm for the maximum flow on a directed graph with capacities, and implement scaling on top of this code. You write a function
void maximum flow scale(int n, int s, int t, int *capacity, int *flow)
with the same arguments as the function maximum flow in Homework 3:
- n: the number of vertices of the graph,
- s: the start vertex,
- t: the target vertex
- capacity: the matrix of edge capacities.
- flow: the matrix used to return the maximum flow.
Scaling is a method to speed up the Ford-Fulkerson Algorithm for flows with large integer capacities. You construct a sequence of auxiliary capacities CAPi
from the original
capacities CAP0 by halving all capacities (integer division: rounding downward). Let CAPk be the last of these matrices which is not all zero. You solve first the problem with capacities
CAPk with your Ford-Fulkerson code; then you take the flow you found, double all flow values,and take that as initial flow for the capacities CAPk−1, and solve the problem for those capacities. You continue this doubling until you are back at the original
capacities. Since each step has a cut of size at most n − 1, each of the intermediate flow problems can augment at most n − 1 times, and there are only log(MaximumCapacity) many intermediate problems.
Wave speed for transverse traveling waves on the string
: A string on a musical instrument vibrates in its fundamental mode with nodes on either end. The length of the vibrating segment is 0.39 m. The maximum transverse velocity at a point in the middle of the string is 3.8 m/s and the maximum transverse ac..
|
What is moment of inertia of each rod about axis of rotation
: A ceiling fan consists of a small cylindrical disk with 5 thin rods coming from the center. The disk has mass md = 3.3 kg and radius R = 0.22 m. The rods each have mass mr = 1.2 kg and length L = 0.76 m. 1) What is the moment of inertia of each rod a..
|
What is the moment of inertia of the whole ceiling fan
: A ceiling fan consists of a small cylindrical disk with 5 thin rods coming from the center. The disk has mass md = 3.3 kg and radius R = 0.22 m. The rods each have mass mr = 1.2 kg and length L = 0.76 m.3) What is the moment of inertia of the whole c..
|
Time value of money practice problems
: Time Value of Money Practice Problems, Calculate the total dollars accumulated at the end of thirty years if you invest $1,000 per year starting today at 8% per year.
|
Take the code you wrote for the ford-fulkerson algorithm
: Take the code you wrote for the Ford-Fulkerson algorithm for the maximum flow on a directed graph with capacities, and implement scaling on top of this code. You write a function
|
Determine the maximum compression of the spring mounted
: The 30-Mg freight car A and 15-Mg freight car B are moving toward each other with the velocities VA= 20 km/h to the right and VB= 10 km/h to the left. the spring constant on car A is k= 3MN/m.
|
Calculate the couple c a that must be supplied by the
: The table lamp consists of two uniform arms, each weighing 0.8 lb, and a 2-lb bulb fixture. If ? = 16? , calculate the couple C A that must be supplied by the friction in joint A.
|
Determine which of the following statements is true
: The velocity and pressure are given at two points in the flow field. Assume that the two points lie in a horizontal plane and that the fluid density is uniform in the flow field and is equal to 1000 kg/m^3. assume steady flow. Then, given these data,..
|
What are the spcs83 coordinates and convergence angle
: What are the SPCS83 coordinates and convergence angle for a station in the Colorado Central zone with geodetic coordinates of 39° 44’ 40.74141”N, 105° 00’ 07.48466”W
|