1. Say that we are given a maximum flow in the network. Then the capacity of one of the edges e is increased by 1. Give an algorithm that checks if the maximum flow has increased
2. When we increase the capacity of some edge by 5 can it be that the flow does not increase at all?
3. When we increase the capacity of an edge by 5, can the flow grow by 7?
Please write time complexity for the algorithms
1. Let (u,v) be the edge whose capacity has been increased by 1 unit then either this will increase the flow by 1 unit or will not increase the flow at all. Adding one to capacity of (u,v) will increase the flow value if and only if vertex u is reachable from source vertex in the residual graph and also vertex v should have path to vertex t in the residual graph.
Thus we need to check these two condition. Below is the algorithm, which perform Breadth First Search to check whether u is reachable from s by performing BFS with s as source and also whether t is reachable from v by performing BFS from v.
Algorithm(G=(V,E),(u,v)) //G is the residual graph
1. Perform BFS from vertex s.
2. If this BFS does not cover vertex u then return 0 because flow will not increase.
3. Perform BFS from vertex v
4. If this BFS does not cover vertex t then return 0 because flow will not increase.
5. Otherwise return 1 because flow will definitely increase.
So we need to perform two BFS only and hence time complexity = O(V+E)
2. Yes this can happen. If the edge whose capacity we are increasing is not the part of any min-cut then increasing its capacity will not increase any flow value at all.
3. No this cannot happen. If we increase the flow by 5 unit, then there can at most be flow increment by 5 unit.
Please comment for any clarification.
1. Say that we are given a maximum flow in the network. Then the capacity of one of the edges e i...
Please explain Remarks: In all algorithm, always prove why they work. ALWAYS, analyze the com- plexity of your algorithms. In all algorithms, always try to get the fastest possible. A correct algorithm with slow running time may not get full credit. In all data structures, try to minimize as much as possible the running time of any operation. . Question 4: 1. Say that we are given a mazimum flow in the network. Then the capacity of one of the...
5 Network Flow, 90p. Consider the below flow network, with s the source and t the sink. 5 4 1. (10p) Draw a flow with value 8. (You may write it on top of the edges in the graph above, or draw a new graph.) You are not required to show how you construct the flow (though it may help you to apply say the Edmonds-Karp algorithm). 2. (5p) List a cut with capacity 8. (You may draw it in...
Say that we have an undirected graph G(V, E) and a pair of vertices s, t and a vertex v that we call a a desired middle vertex . We wish to find out if there exists a simple path (every vertex appears at most once) from s to t that goes via v. Create a flow network by making v a source. Add a new vertex Z as a sink. Join s, t with two directed edges of capacity...
1. Linear programming can be used to calculate the maximum flow in a network from the source s, to the sink t. Which of the following statements below gives the correct objective function, and number of constraints for applying a linear program for computing maximum flow in the following graph? In this graph, the maximum capacity of each edge is given as the number next to the corresponding edge. The flow along an edge eſi, j) is denoted by fij....
We will look at how the Ford-Fulkerson Algorithm operates on the following network.Each edge is annotated with the current flow (initially zero) and the edge's capacity. In general, a flow of x along an edge with capacity y is shown as x / y.(a) Show the residual graph that will be created from this network with the given (empty) flow. In drawing a residual graph, to show a forward edge with capacity x and a backward edge with capacity y,...
Let (G, s, t, c) be a flow network G = (V, E), A directed edge e = (m u) is called always fu ir f(e) e(e) forall maximum fiows f: it is called sometimes fullit f(e)for some but not all maximum flows: it is caled never fulit f(e) <c(e) for all maximum flows. Let (S, V S be a cut. That is, s E S,teV S. We say the edge u, ) is crossing the cut ifu E SandrEV\...
Question 1: Given an undirected connected graph so that every edge belongs to at least one simple cycle (a cycle is simple if be vertex appears more than once). Show that we can give a direction to every edge so that the graph will be strongly connected. Question 2: Given a graph G(V, E) a set I is an independent set if for every uv el, u #v, uv & E. A Matching is a collection of edges {ei} so...
Have the explaination please. 4 Graph Application: Network Connectivity (Adapted from Problem 9, Chapter 3 of K&T) Think of a communications network as a connected, undi rected graph, where messages from one node s to another node t are sent along paths from s to t. Nodes can sometimes fail. If a node v fails then no messages can be sent along edges incident on v. A network is particularly vulnerable if failure of a single node v can cause...
1. (25) [Maximum bottleneck rate spanning treel] Textbook Exercise 19 in Chapter 4. Given a connected graph, the problem is to find a spanning tree in which every pair of nodes has a maximum bottleneck rate path between the pair. (Note that the bottleneck rate of a path is defined as the minimum bandwidth of any edge on the path.) First give the algorithm (a sketch of the idea would be sufficient), and then prove the optimality of the algorithm....
please I need it urgent thanks algorithms 2.1 Searching and Sorting- 5 points each 3. What is the worst case for quick sort? What is the worst case time com- plexity for quick sort and why? Explain what modifications we can make to quick sort to make it run faster, and why this helps. 4. Give pseudocode for an algorithm that will solve the following problem. Given an array AlL..n) that contains every number between 1 and n +1 in...