Network flow title three heteroatoms

A. 1565: Zombies

Consider the relationship between the protection of a ring may be, that is, any one of them must not be selected.

Note ring of the side also can not be selected.

Note that the loop looking for the network side is not built FIG edge flow, since the network must be selected stream reflects the relationship, i.e. the protectors to be protector.

Then the maximum weight is a simple closed subgraph.

 

B. sushi restaurant

It does not seem difficult, but did not expect.

Consider each removal $ (l, r) $, then it must be removed $ (l, r) $ any one subset.

The method of construction is simple to build side edge $ (l, r) -> (l, r-1) $ $ (l, r) -> (l + 1, r) $.

And then found a statistical comparison downright content is selected to spend, it seems simple conversion of selected $ (x, x) $, which represents the node to be selected later spend.

Because the cost of each different first selected, so that even then a $ $ INF edge represents one selected from the first cost, the cost for the selected difference enough.

 

C. 51nod 1551 collection trading

And to ensure that any set as greater than $ k $ sets is equal to $ k $, then the

Hall Theorem Corollary:

Suppose both sides of the set of points are X, Y (assuming | X | <= | Y |),

The maximum number of matches of the bipartite graph is | X | -max {| W | - | N (W) |}, where W is a subset of X

Artwork available there is a perfect match.

Then each collection can be found on behalf of its corresponding element.

When you select the $ k $ sets, because each set corresponding to different from each other representative elements, has reached a $ k $ limit.

Further elements of the set can not contain any one selected not selected.

Then when a selected set, which corresponds to each element of the set should be selected.

 

D. 2406: Matrix

Consider testing the answer is less than equal to $ k $ whether it is feasible.

The ranks were placed in the left and right portions of the bipartite graph, respectively $ s $ $ t $ connected edges.

Even among the ranks corresponding to the edge where the grid, any traffic.

Flow $ 1 $ corresponds to the source - the ranks - sink, namely a grid to contribute $ 1 to $ where the sum of the ranks, respectively.

So through the ranks of the upper and lower bounds and limitations.

Half and then verify the existence of feasible flow like in the upper and lower bounds significance.

 

E. story extension

Upper and lower bounds minimum cost feasible flow.

$ Spfa $ constantly looking for the shortest path up the stream, and then get away.

According to my original understanding this is unreasonable: when $ s $ to $ t $ exists between a negative flow augmenting path can be made smaller cost in meeting the upper and lower bounds.

However, the god of $ yxs $ pointed out such a situation does not exist: the existence of a $ t $ $ $ 0 cost between $ s $ edge, if there is a negative flow augmenting path, a negative ring $ spfa $ die.

 

F. 1061: Volunteer Recruitment

The difficulty is how to think of passive sinks.

After the thought is gone, the series can represent inheritance, limit traffic through the upper and lower bounds.

In between the start and end points, new points of each employee to build a ring, and then run the passive exchange bounds minimum cost feasible flow just fine.

 

G. confused when traveling

Upper and lower bounds minimum feasible flow.

 

H. clean up trails

Upper and lower bounds minimum feasible flow.

On the basis of an active exchange feasible flow on a practice:

Remove t-> s flow rate side, to the flow lines in the flow s to t, and represents the flow rate has flowed in.

Deletion t-> s this edge.

S t into consideration the flow in the residual network, corresponding to the t s to flow back.

Subtracting the flow rate to the maximum flow s to t, it represents the largest possible back flow.

Another approach is:

To not build t-> s this edge, as far as possible up the stream, it does not necessarily run full flow case.

After building a t-> this edge, in the remaining amount of network traffic can still augmented out, try not to go in t-> S under the premise of this edge, i.e., the minimum feasible flow.

 

Guess you like

Origin www.cnblogs.com/skyh/p/12008906.html