Network stream/bipartite graph Summary (2)

Source: Internet
Author: User
ArticleDirectory
    • Max weight closure Diagram
    • Minimum vertex weight overwrite in a Bipartite Graph
    • Maximum vertex weight independence set in a Bipartite Graph
Previous Article: network stream/bipartite graph Summary

The last article is the most basicCodeTo achieve this, I would like to add one point. By the way, I would like to summarize the network stream questions I have already done.

Some Algorithm Max weight closure Diagram

For more information, see hu botao's thesis. Connect s to the normal weight point. The traffic is the point weight, and the negative weight point is connected to T. The traffic is the absolute value of the change weight. Replace the directed edge of the source image with the edge where the traffic is INF, and find the minimum cut, that is, the maximum weight.

Question: noi2006 maximum profit

Minimum vertex weight overwrite in a Bipartite Graph

Connect s to the point on the left, connect T to the point on the right, the traffic is the weight of the point, the original edge of the bipartite graph is the edge with the traffic INF, min cut = weight of least vertex weight Overwrite

Maximum vertex weight independence set in a Bipartite Graph

Weighted and least vertex weighted overwrite. The relationship with the above is like the relationship between the Independent Number and the minimum coverage Number of the Bipartite Graph. However, if the weight is added, it is necessary to convert it to the maximum flow solution.

Some questions

1. Calculate the number of entries/squares

2. tyvj 1338

The maximum vertex weight of a bipartite graph is overwritten.

Code: http://fayaa.com/code/view/20890/

3. HDU 1569

The number of squares is given. The number of adjacent edges cannot be obtained. Classic question: the biggest vertices of a bipartite graph are covered. The previous question is basically adapted from this classic question. But I cannot debug it because HDU handed in some PascalProgramCompilation always fails, so this question was written in C. After a month, I also referred to other people's code. The details and languages are different from the previous one. It is a bit difficult to find out. Currently, it is wa. Write it in the code comment

Code: http://fayaa.com/code/view/20891/

3. rqnoj 77

A weighted undirected connected graph is provided, which requires removing some edges so that the existing two vertices are no longer connected, and the sum of the smallest edges is obtained. This is the global minimum cut for an undirected graph. You can enumerate the Source and Sink points and find the minimum cut. Actually, you only need to fix the source point and enumerate the sink points.

Code: http://fayaa.com/code/view/20892/

There is a stoer-Wagner algorithm, and there is an elegant solution to this problem. However, the application is too narrow, so there is no in-depth understanding. For more information, see

Http://www.cppblog.com/imky/articles/123427.html

Http://www.rqnoj.cn/Discuss_Show.asp? Did = 4234

4. rqnoj 306

A: The oil pipeline is a non-directed flow chart. When the maximum flow condition is reached, each pipeline has a compression index. When the oil flow exceeds this number, the pipeline will explode. An organization can reduce the compressive index of a pipe by 1. To reduce the pressure resistance index of pipelines, the oil transportation network in rare countries will be destroyed.

Algorithm: From rqnoj question: when the maximum stream is run, the closure is passed in the residual network, and the edge of two vertices with different connection States is output, so the saturated arc cannot be obtained, because the input edge may be undirected after a circle or the largest stream.

Code: http://fayaa.com/code/view/20893/

5. poj 2135

Http://www.cnblogs.com/oa414/archive/2011/06/05/2073294.html

6. poj 3469

The diagram is amazing!

Http://hi.baidu.com/legend_ni/blog/item/6cef550694bca810738da5d2.html

Http://hi.baidu.com/%D2%D5%C1%D6010/blog/item/90b649cc7b47045c0eb3454d.html

Code: http://fayaa.com/code/view/20895/

7. HDU 3046

Pleasant goat and gray wolf ......

Given the square where the sheep and the wolf are located, the sheep must build a wall to enclose themselves and find the minimum length of the wall.

Algorithm: this algorithm is used to calculate the minimum cut for a wolf-connected source point, a goat-connected sink point, and an edge with a price of 1 in the adjacent square.

The code is Pascal, and only the sample code has passed. The HDU compilation fails.

Code: http://fayaa.com/code/view/20896/

A little nonsense

I thought I had done a lot of questions about network streams, but I didn't expect that much. I haven't written it for several weeks. when I picked it up again a few days ago, I had to write a program like sap. There are still a lot of questions about Wa, which are not quite clear yet. In addition, I want to learn about algorithms such as dinic and pre-stream pushing. By the way, I want to review Ek. I also want to know about zkw algorithm and deploy algorithm of the billing flow, in addition, KM still does not fully understand it. In this period of time, we will try our best to do this and find some questions about the network stream/bipartite graph. At that time, we will write the third summary.

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.