Overlapping region resolution

Scott David Daniels Scott.Daniels at Acm.Org
Thu May 21 23:17:36 CEST 2009


psaffrey at googlemail.com wrote:
> This may be an algorithmic question, but I'm trying to code it in
> Python, so...
> 
> I have a list of pairwise regions, each with an integer start and end
> and a float data point. There may be overlaps between the regions. I
> want to resolve this into an ordered list with no overlapping
> regions.
> ... (indication of having at least struggled a bit) ...
> Devising an algorithm to do this is making my brain hurt. Any ideas?

I really hope I'm not giving away the key to a homework problem.
One sort key for such lists that I've found fruitful in the past is:
     (start, -end)
Maybe it will prove helpful to you as well.

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list