Finding the residual capacity - data-structures

How to find the maximum amount by which we can increase the flow on each edge in an augmenting path in a directed graph?
Or you can say how to find the residual capacity in an augmenting path?

Should probably consider opening your textbook to do homework rather than asking online.

Related

Find Disjoint Graph with Smallest Overall Cost

This is an optimization / minimum flow problem. For this directed graph, I would like all vertices to be visited exactly once, but this graph can exist multiple disjoint paths, and each path has constraints on its total cost. The goal of this problem is to minimize the total cost of all disjoint paths.
I only know how to find Dijkstra shortest path, and I am not sure if similar principle can be applied. Please help me out and share your thoughts on this.
Thank you so much!
It sounds to me you are describing a vehicle routing problem, where each route is constrained e.g. by the vehicle capacity or maximum travel time. Have a look at https://en.wikipedia.org/wiki/Vehicle_routing_problem.

Max flow in unweighted graph

Max flow problem is usually solved by edmond-karp algorithm, which is building residual graph, and using BFS to find augmenting paths.
But usually max flow problem is defined for weighted graph. For unweighted graph, we can simply treat the weight of each edge as 1, but I wonder if there is any simpler algorithm to solve the unweighted version.
Usually people refer to edge "capacities" when talking about flow problems, and "weights/costs" when talking about distance related problems. This causes less confusion.
To rephrase your question, does there exist a simpler algorithm for the max flow problem when every edge has the capacity of 1?
It really depends on what you mean by "simpler", but you can use Ford-Fulkerson algorithm to solve this special case in O(VE) time bound, which is much faster than solving it with the aforementioned Edmonds-Karp algorithm with the time bound of O(VE^2).

Ford-Fulkerson algorithm in a graph with links with weight 1

In a max flow problem, when I apply a ford-fulkerson algorithm to find the max flow, if all the links of the graph have weight 1, the max flow will be the number of paths that I've found in the ford fulkerson algorithm right? I mean, the number of dfs paths.
Thanks.
Yes, the maximum flow capacity is equal to the number of edge-distinct paths from source to sink.
Also, for the case of unit distances, most network flow algorithms have much stronger time complexity bounds then in general.

modification of bfs for ford fulkerson algorithm,to find augmenting path

i am using bfs to find augmenting path.but it is producing same path every time.but ford fulkerson algorithm requires that,we choose different path every time from source to sink,so can somebody suggest me how to modify bfs so that it produces different path every time between source and sink.graph is directed and weighted
You need to make sure that the BFS ignores edges where all of the capacity has been used. Usually, the BFS is being run on the so-called residual network, in which each edge capacity tells how much capacity remains on that edge (given the flow you've sent through that edge). You can either maintain a separate residual graph, or you can have an implicit one by making the BFS look at the difference between the original capacity and the current flow for each edge (and treating an edge as absent if its capacity is zero).

Is finding a simple path in a weighted undirected graph with maximum cost in polynomial time? Is it NP?

I need to know if it is possible to find a simple path with maximum cost in any weighted undirected graph.
I mean to find THE MOST expensive path of all for any pair of vertex.
Input: Graph G = (V,E)
Output: The cost of the most expensive path in the graph G.
Is this problem NP-Complete?, I think it is. Could you provide any reference to an article where I can review this.
You're not the first to think of this problem. In fact, it was the first link in the google search results.
edit
Guys, un-weighted graph is a special case of weighted graph: all edges have weight 1 :)
This is similar to traveling salesman, except your heuristic is the Max and not Min. Read up on the traveling salesman.
The problem is NP complete because it can be derived from a problem that is already proven to be NP-Complete (Traveling salesman). The answer is checkable in polynomial time, but an answer cannot be found in polynomial time.
Read http://en.wikipedia.org/wiki/Travelling_salesman_problem
Yes, this problem is NP because you are asking for the maximum which means that you'll need to go through all possible paths. The decision version of this problem ("is there a path of length n?") is known NP-complete (as noted above).

Resources