I have been trying to come up with an algorithm to determine how many objects will overlap / happen at the same time, given a date timeframe. Each object has a lifetime of 10 days. You are given a certain number of objects, and the dates that these objects start. My goal of this algorithm is to determine how many objects could be happening at the same time.
For example, say you are given 6 objects and their start dates:
Object 1: 9/25/11
Object 2: 9/13/11
Object 3: 10/3/11
Object 4: 10/8/11
Object 5: 10/21/11
Object 6: 10/10/11
Here is a visual of these objects to help show the idea of what I mean by object "overlap":
So... visually, it is pretty easy to see that the maximum number of objects that "overlap" is 3 (Objects 3, 4, and 6). There is also an overlap of 2 at the beginning of October with objects 1 and 3. So my question is: How can I find the maximum overlap of X objects, given the start dates for each object? Any help would be greatly appreciated!