Reputation: 312
I was asked to develop an algorithm for the following problem :
Given :
Delete exactly K edges so that the flow of the network is minimized.
My thoughts/algorithm :
If K is greater than or equal to |F| delete ALL of the edges that cross G's Minimum cut and if K is still greater than zero delete random edges and the new max flow is zero
If K is equal to |F| delete ALL of the edges that cross G's Minimum cut and the new max flow is zero
If K is less than |F| delete K of the edges that cross G's Minimum cut and the new max flow is |F|-K
I am in need of some validation as the Max Flow/Min Cut is new to me. Lastly the intuition behind the Max Flow/Min Cut that i got is that the Min (Source,Sink) cut works as a "bottleneck" to the maximum flow we can push in the network.Is that right?
Upvotes: 0
Views: 3304
Reputation: 2777
Yes min cut is "bottleneck" for flow, also |Min-Cut| = Max-flow
. There's tons of proofs online if you're interested (it's known as max-flow min cut theorem).
For your algorithm there's no need to delete random edges in step one, deleting one edge from min-cut reduces max-flow by the flow that goes through that edge (in this case 1
cause all weights are 1
according to statement).
So solution is just:
min(K, |Min-cut|
edges from the graph)Finding Min-Cut can be done very easily:
Upvotes: 3