title: Maximum event interceptions
body: <p>I'm trying to figure out an algorithm that will detect the maximum number of intersections of events over time. The following picture will explain the situation. </p>
  
  <p>I have multiple events that can overlap and I have to determine what is the maximum overlap among all the events. </p>
  
  <p><strong>What I know?</strong></p>
  
  <p>I know <strong>event ID</strong>, <strong>start time</strong> and <strong>end time</strong>. I also have <strong>coordinates</strong>.</p>
  
  <p><strong>What is maximum event overlap?</strong> </p>
  
  <p>In this case showed in picture, the maximum is <strong>3</strong>. This is because at one time there are only 3 events that are overlapping. E.g ID's: <code>1,3,4</code> or <code>1,3,5</code>.</p>
  
  <p><a href="https://i.stack.imgur.com/FSVde.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FSVde.png" alt="Events in time"></a></p>
  
  <p>I have a solution that requires a lot of cycles. But I can't figure out some fast elegant solution suitable for a web application with many events.</p>
  
  <p>Thank you for all your answers in advance. If you find some grammar mistakes, please edit the post. Thanks.</p>