1
votes

The problem that I am trying to solve is as follows:

Given a directed graph, find the minimum number of paths that "cover" the entire graph. Multiple paths may go through the same vertice, but the union of the paths should be all of them.

For the given sample graph(see image), the result should be 2 (1->2->4, and 1->2->3 suffice).

By splitting the vertices and assigning a lower bound of 1 for each edge that connects an in-vertex to an out-vertex, and linking a source to every in-vertex and every out-vertex to a sink (they are not shown in the diagram, as it would make the whole thing messy), the problem is now about finding the minimum flow in the graph, with lower bounds constraints.

Sample graph

However, I have read that in order to solve this, I have to find a feasible flow, and then assign capacities as follows : C(e) = F(e) - L(e). However, by assigning a flow of 1 to each Source-vertex edge, vertex-Sink edge, and In-Out edge, the feasible flow is correct, and the total flow is equal to the number of vertices. But by assigning the new capacities, the in-out edges (marked blue) get a capacity of 0 (they have a lower-bound of 1, and in our choosing of a feasible flow, they get a flow of 1), and no flow is possible.

Fig. 2 : How I choose the "feasible flow" Image 2

However, from the diagram you can obviously see that you can direct a 2-flow that suffices the lower-bound on each "vertex edge".

Have I understood the minimum flow algorithm wrong? Where is the mistake?!

1
When I find the feasible flow, should I make sure that the flow on each edge would be greater than the solution to the minimum flow problem? Because if it is not, then I can't see any way the algorithm would provide me with the good flow. - lbicsi

1 Answers

0
votes

Once you have the feasible flow, you need to start "trimming" it by returning flow from the sink back to the source, subject to the lower bound and capacity constraints (really just residual capacities). The lower two black edges are used in the forward direction for this, because they don't have flow on them yet. The edges involving the source and the sink are used in reverse, because we're undoing the flow already on them. If you start thinking about all of this in terms of residual capacities, it will make more sense.