Pku3308 [theory] how to transform the vertex coverage Problem of a bipartite graph into a minimum cut

Source: Internet
Author: User

In the bipartite graph, there is a problem: vertex overwrite.

Figure GVertex OverwriteQ is a set of vertices that contain V (G). Q contains at least one endpoint on each edge. All vertices of Q overwrite edge set E (G ).

If the overwrite of each vertex requires a different price, it can be said that it is a different cost, or a point right, the problem can be described as: when the edge is overwritten, how to minimize permissions.

Here we will only talk about the bipartite graph.

We can create the Source Vertex s and the sink vertex T. Assume that the two points in the bipartite graph are X and Y respectively. The original edge capacity of X and Y is set to INF, and each vertex x in S to X is connected to an edge, and the edge weight is the vertex weight of X, it can also be seen as the cost of covering all outbound edges of vertex x (W-). Each vertex y to vertex t in Y is connected to an edge, and the edge right is the vertex right of Y, it can also be seen as the cost of covering all the inbound edges of point y (W + ). In this way, the minimum cut capacity is obtained, that is, the solution to the original problem.

It can be understood as follows: if the edge weight from X to Y is INF, it will not become the edge in the smallest cut, and only the side from S to X and Y to T may be: the edge E1 from S to X's midpoint X has the point weight of point X. All edge E2 in point X and Y are subject to the traffic limit of E1. Similarly, all the edges between x and y are also limited by the capacity from point y to T. In this way, the cut can ensure that all edges are overwritten.

We can use the reverse verification method to prove that if the edge <X, Y> is not overwritten, the edge <s, x> traffic is 0 and the edge <y, t> if the traffic is 0, and the <X, Y> traffic is INF, you can find a stream increasing path from S to T <s, X, Y, T>, if it is inconsistent with the maximum stream obtained, it means that all edges have been overwritten in the case of the maximum stream.

The minimal cut problem can be solved using the maximum stream, and the problem becomes simple.

Paratroopers

This is a good example.

Question: In a war between Mars and the earth, if Mars is about to attack the earth, it will send a parachute in a m * n place. The commander on the earth will receive this message, to create a weapon in several rows or columns, you only need one weapon to destroy the entire row or entire array of enemies. Ask how to arrange to destroy all enemies. Different weapons have different costs. The construction of the entire defense system equals the cost of each weapon.

Analysis: regards paratroopers as edges, columns as nodes, rows as X sets, and columns as y sets. If Column B of Row A has enemies, it connects node A and Node B. The result obtained is the largest product of cost. You can use log to calculate the logarithm of each edge, which can be converted into a summation problem. The obtained result is replaced by the exp function, convert to the smallest cut, and convert to the largest stream, so that the above method can be used to solve the problem.

The data volume is small, and the result can be achieved through the adjacent matrix + Ek.

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.