Take the code you wrote for the ford-fulkerson algorithm

Assignment Help C/C++ Programming
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.

Reference no: EM13550445

Questions Cloud

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

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd