A few brilliant words from Good morning

Source: Internet
Author: User

1. volunteer recruitment

It is very convenient and easy to understand according to the traffic balance equation. It may become one of the ways to create network streams in the future.

Let's take a look at the steps of the traffic balance equation ing method:

A. List demand Inequalities

B. Change the inequality to an equation by setting the relaxation variable.

C. subtract from each other to obtain the traffic balance equation.

D. observe the equation.> 0 indicates the obtained traffic. <0 indicates the output traffic. If it is a variable related to the demand, it is connected to the source and sink, if it is a cost-related variable, the related equation is mapped to the edge

E. Use the maximum flow algorithm with minimum cost

Specific EDGE connection method: Make oo = maxlongint, and connect (I, J, K, L) indicates that the I-to-J connection capacity is K, and the cost is L.

A. make a [0] = A [n + 1] = 0, for a [I]-A [I-1]> 0 (S, I, A [I]-A [I-1], 0), and a [I]-A [I-1] <0, then connect (I, T, A [I-1]-A [I], 0)

B. Connect (I + 1, I, Oo, 0)

C. For each type of volunteers (x, y, z), connect (X, Y + 1, Oo, Z)

2. Summary

The essence of network stream is actually greedy.

Network flows are inseparable from inequalities and traffic balancing equations. In a sense, they can even be equivalent.

Network stream can often deal with optimization problems with strong Dependencies

You must be familiar with some classic network stream models, such as the application of the smallest cut model in the largest weighted closed graph, and the shortest circuit of the plan network flow (which is also possible in other words)

If you want to use a network stream to create a question, you must list the target type, specify the direction for optimization, and make it impossible to do anything through the deformation of the form; or directly column the traffic balance equation to figure out

The cost stream adds one dimension to the maximum stream. The more powerful the function, the slower the speed.

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.