Re: merging intervals repeatedly

2008-03-14 Thread Robert Bossy
Magdoll wrote: >> One question you should ask yourself is: do you want all solutions? or >> just one? >> If you want just one, there's another question: which one? the one with >> the most intervals? any one? >> > > I actually don't know which solution I want, and that's why I keep > trying di

Re: merging intervals repeatedly

2008-03-12 Thread Magdoll
> Hi, > > The problem, as stated here, may have several solutions. For instance > the following set of intervals also satisfies the constraint: > (1,15), (20,40), (50,100) > > One question you should ask yourself is: do you want all solutions? or > just one? > If you want just one, there's another

Re: merging intervals repeatedly

2008-03-12 Thread Robert Bossy
Magdoll wrote: > Hi, > > I have to read through a file that will give me a bunch of intervals. > My ultimate goal is to produce a final set of intervals such that not > two intervals overlap by more than N, where N is a predetermined > length. > > For example, I could read through this input: > (1,

Re: merging intervals repeatedly

2008-03-11 Thread Magdoll
On Mar 11, 11:01 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Tue, 11 Mar 2008 15:43:40 -0700 (PDT), Magdoll <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > Correct. I meant the final should be > > (1,30), (29,40), (50,100) > > Actually, even that is incorr

Re: merging intervals repeatedly

2008-03-11 Thread castironpi
> > Correct. I meant the final should be > > (1,30), (29,40), (50,100) > >         Actually, even that is incorrect -- note that ,30 overlaps 29, Actually, given the specification, (overlaps > N count), (1,15), (20, 30), (29, 40), (50, 66), (62,100) is right, since 66-62= 4<= 5. [1] >         Sin

Re: merging intervals repeatedly

2008-03-11 Thread Magdoll
Correct. I meant the final should be (1,30), (29,40), (50,100) On Mar 11, 3:41 pm, Magdoll <[EMAIL PROTECTED]> wrote: > Hi, > > I have to read through a file that will give me a bunch of intervals. > My ultimate goal is to produce a final set of intervals such that not > two intervals overlap by m

merging intervals repeatedly

2008-03-11 Thread Magdoll
Hi, I have to read through a file that will give me a bunch of intervals. My ultimate goal is to produce a final set of intervals such that not two intervals overlap by more than N, where N is a predetermined length. For example, I could read through this input: (1,10), (3,15), (20,30),(29,40),(5