First, strip out all the lines that never have failed combinations. Then sort the remaining lines.

Now, set a threshhold to 1, or maybe 1.5. Threshhold is called T.

For the first line, start with the first valid point P such that 100-T>=P. A point is valid if no line below it (in the sorted array of line points) has a point at the same X that is within T of it.
For the second and subsequent lines, find the first point Pn such that Pn is a valid point and (Pn-1)-T >= Pn.
This makes labels look decent.
