Title: http://www.lydsy.com:808/JudgeOnline/problem.php?id=1497
Analysis:
This is a problem in the graph, and the edge is dependent on the point, there is a dependency between the points in the graph and the edges, you can consider the maximum right closed sub-graph
Suppose an edge between A and b that has a value of C (according to test instructions is a bidirectional edge)
Then we can build a new node, the weight of the point is C, and point to point A and point B (unidirectional), while breaking the two-way edge between the original, A, B, the weight of the point is their cost (negative)
Then the problem of the original problem is converted to the maximum right of the closed sub-graph.
————————————————————————————————————————————————————————————————
Most powerful closed sub-graph
Definition: To select a point set V ' in the graph, must meet for each point in V ', its successor also in V ', select a bit of weight and the largest point set V '
Algorithm:
To get a source point S, the meeting point T,s the point that the ownership value is positive, the capacity is the weighted value of the point, the point that the ownership value is negative to the T, and the absolute value of the weight of the point.
Then the maximal weight closure sub-graph is equal to the minimum cut, and then the maximum flow problem is converted.
Proof: http://wenku.baidu.com/link?url=Q7LKOvCRFeMQkY1WulrZTAHjN3ud8gbhuqUOKwPbwmGDAmCB0_ urdekj59wkwvrgn9xsg9tgbwsmhhbimxvgs2wmbenrxre6zuseo2v3mx7
——————————————————————————————————————————————————————————————————
In fact, this problem has a better algorithm, see the 2007 Training Team paper
[Bzoj 1497] [NOI 2006] Maximum profit (maximum weight closed sub-chart)