views:

94

answers:

1

Given a parameter k, I'm trying to delete k edges from a directed graph such that the maximum flow is reduced by as much as possible. The graph has a source s and a sink t, and the capacity of each edge is one. The graph may or may not contain cycles.

My proposed solution would be to first perform a topological sorting on the graph, using an algorithm that "forgives" cycles -- perhaps by ignoring edges that lead us back to the source. Then (assuming k >= 1):

i = 0
for each vertex u order by topological(u)
   for each edge (u, v) order by topological(v) descending
       if topological(v) > topological(u) then
            delete (u, v)
            if ++i = k then return
       else
            // edge doesn't contribute to max flow, ignore

Would this work, or am I totally off-track here?

+1  A: 

I think you are totally off-track. Your algorithm might not reduce the flow at all, while it is possible to reduce the max flow by at least k (or make it 0).

Do you know the max-flow min-cut theorem?

Moron
I know it in that I've memorized "the maximum value of an s-t flow is equal to the minimum capacity that must be removed so that no flow can go from s to t," but it's not immediately clear to me how that will help me in this situation. Do we want to find s-t cuts in the graph and take away edges that cross the cut?
ArIck
@Arlck: I suggest you try to answer that question yourself.
Moron