"Self-occupied" network flow with upper and lower bounds

Source: Internet
Author: User

Link:
#include <stdio.h>int main(){    puts("转载请注明出处[vmurder]谢谢");    puts("网址:blog.csdn.net/vmurder/article/details/45242511");}
No sink network Stream (graph):

The final maximum flow needs to be a loop body, where the flow flows in the internal loop.

Must flow and the definition of free flow:

First, the upper bound of each edge is flow, the lower bound is low, then there is a low must flow and flow-low free flow.

"No Yuanhui" has the upper and lower bounds of the "feasible" Flow: Map:

All incoming flows that record each point must flow in and all outgoing must flow out.
The new map then sets up a super source and a super meeting point,
For each edge, keep its free-flow capacity,
For each point, if in-out<0, point to the sink point to the capacity of the out-in, and vice versa source to point to in-out capacity.

Judge:

Then run the maximum flow, if the source point full flow is feasible.

"No Yuanhui" has a "maximum" flow of the upper and lower bounds:

The maximum flow is the number of rings that can be split into 1 of the flow, first for a graph with a fixed end-use capacity for each edge.
If you follow the usual method of running a residual network after the creation of Super Yuanhui, you may only enumerate points with the remaining traffic as a single source point, so we cannot guarantee that each augmentation will make the answer better. There should be no relevant methods on the Internet, Konjac konjac I have wasted a number of brain cells and proved that I am such a weak person does not have the brain to complement the practice.

"Yuanhui" has a "feasible" flow in the upper and lower bounds:

We can connect a lower bound from the sink to 0, the upper bound for the INF edge to the source point, which translates into a "no Yuanhui" has a "feasible" flow.

"Yuanhui" has a "maximum" flow of the upper and lower bounds:

Let's run first. "Yuanhui" has the upper and lower bounds of the "feasible" flow, to get the maximum flow of maxflow1, and then delete Xinyuan and new sinks on the residual network, and then do the bare maximum flow, get the maximum flow of maxflow2, then the final answer is Maxflow1+maxflow2.

"Yuanhui" has a "minimum" flow in the upper and lower bounds: a case of the wrong method:

The super-source traffic and when the feasible flow is directly converted.
Inverse example: (Edge format is start, end, lower bound, upper bound)
S:1, T:4
1 2 10 100
2 1 1 100
1 3 10 100
3 1 1 100
3 4 1 100
The feasible flow answer is 17, but the minimum flow is 1.
Because you can loop the flow of the meter to make the same traffic several times on an edge.

Positive solution:

One
All incoming flows that record each point must flow in and all outgoing must flow out.
The new map then sets up a super source and a super meeting point,
For each edge, keep its free-flow capacity,
For each point, if in-out<0, point to the sink point to the capacity of the out-in, and vice versa source to point to in-out capacity.
(completely copied from "Yuanhui" with "feasible" flow "in the upper and lower bounds").
Two
Super source to Super sink maximum stream, and then on the remaining network from sink to source with a capacity of the INF Edge
Three
At this point the maximum flow of the super-source to the super sink is the minimum stream from the original source to the sink.

Cost-flow solution with upper and lower bounds:

We do special processing, that is, each side (cost K) is split into a must flow (flow A, cost k-inf) and free flow (flow B, cost K) two side,
And then the final answer plus ∑a*inf is good. (Note that the INF here is not a true maximum value, but rather a large number is good)

Principle:

The cost of the small to be selected, and then the election will certainly lose the cost, to be back.

"Self-occupied" network flow with upper and lower bounds

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.