(GCJ-2009 Round 2C) Stock Charts (minimum path coverage)

Meaning of the questions:

Gives N fold lines, fold line such that the number minimum set points are not mutually intersect each

Ideas:

Speaking of the intersection of questions, I could not help think of the computational geometry ... I recently read an estimated computational geometry to see the fire. This question and clever grouping problem into disjoint problem of FIG. Construction Plan which is the bipartite graph, graph theory problems such as the maximum flow hardest want to place (clever)

Polyline disjoint means that these two lines on a lower one. If you have a group of qualified, that is, all the broken line satisfies down relationship. This way we can be abstracted as a polyline point, a -> b represents the top in a b. And -> is the establishment of a directed edge. So we find the relationship between each straight line, if they meet the conditions on the establishment of a directed edge, so since it forms a DAG. The grouping problem is to go through a minimum path, all the points overwritten. WOW, is not that the shortest path bipartite graph coverage problem?

On conclusion through FIG know: the minimum number of paths equal to the number of nodes covering subtracting the maximum number of matches

Guess you like

Origin www.cnblogs.com/Tianwell/p/11502251.html