title: How can I cluster a set of queries with starting and ending times?
body: <p>I'm given a set of queries q_1, q_2, ..., q_m. The query q_i for any 1&lt;=i&lt;=m can be executed several times in different times. I'm also given the starting and ending times of any execution of the query q_i.</p>
  
  <p>Given the above information, I am interested in clustering queries such that a cluster consists of a set of queries that are ''often'' executed within some ''time gaps'' or distance. As it is shown in the following figure, for an example, we are given 5 queries with their execution time windows.</p>
  
  <p><img src="https://i.stack.imgur.com/0XkPr.jpg" alt="A set of 5 queries and their execution time windows"></p>
  
  <p>A feasible clustering algorithm outputs the following result.   </p>
  
  <p><img src="https://i.stack.imgur.com/grTvJ.jpg" alt="Resulting clusters"></p>
  
  <p>Which clustering algorithms do you recommend for my problem?</p>