Maximum flow algorithm based on network flow

Source: Internet
Author: User

One, the definition of network flow: the graph g= (v,e), the point concentration has a source point S, a meeting point T. and s in the degree of 0,t out of 0. For each edge edge, there is a weight function C, which represents its capacity, a weight function f, which represents its actual traffic.

Satisfies the F (edge) <=c (edge) for any one edge.

Definition of the maximum flow: the maximum flow of s to T, without violating the definition of the network stream.

Third, the idea of the Broad road.

Let's consider a network flow: The red number represents the actual traffic, blue indicates the capacity of the edge, and yellow indicates better traffic.

The flow from S to T is 5, but it's obviously not optimal.

This flow is better than the one above, and in fact, this flow is the largest stream of the current network.

We compare the two graphs to draw a

We found that the traffic on each side of the path was added one. Notice that there is a reverse edge of a to B, so when we look for such a path, we should add the remaining flow of all the edges in the original image and the opposite edge of the already traffic (back stream), which is the maximum flow when there is no such path in the diagram. (This path, by the way, is called the wide path).

Four, the algorithm to find the maximum flow:

Maximum flow algorithm based on network flow

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.