Input: Rough event boundary , and root node .
Output: Selected nodes set .
1: Initialization (4).
2: for each query line of do
3: Dequeue node from ;
4: if ( and and are NULL) then
5:  ;
6: else
7:  Add an end node into event query line set ;
8:  Update ;
9:  Add an end node into event query line set ;
10:   ;
11: end if
12:   ;
13: end for
14: Collaborative node selection;
15: return ;
Algorithm 1: Intelligent collaborative event query algorithm.