I have a bunch of (date)intervals which might overlap. The intervals come from different sources. I want to 'flatten' this 'timeline' and then find all intervals where no interval was.
If you look at: http://www.dgp.toronto.edu/people/JamesStewart/378notes/22intervals/ to the "A more complex example" section. I thus want to find the intervals where no composer was alive.
How do I do that? and how would you implement such a thing in PHP? Does PHP also have some easy functions for building the tree?
many thx!
edit My input is a number of arrays (2, 3 or 4) with each containing start and stop dates like so:
$myarray1[0]['start']['date'] = 'somedate'
$myarray1[0]['stop']['date'] = 'somedate'
$myarray1[1]['start']['date'] = 'somedate'
$myarray1[1]['stop']['date'] = 'somedate'
$myarray1[2]['start']['date'] = 'somedate'
$myarray1[2]['stop']['date'] = 'somedate'
the same goes for myarray2, myarray3 and so