|
Algorithm 2: The Candidate Generation and Refinement Framework (CGAR) |
|
Input: A set of trajectory TDB, δG δD,, EPS, MinPts, MaxI and MinL
|
Output: A set of CB-Patterns R
|
|
1: |
SDB = 0̸; // initialize a set of spot sequences |
2: |
for each T ∈ TDB
do
|
3: |
S = extractSpots(T, δG,δD); //extract the spot sequence |
4: |
SDB = SDB ∪ S; |
5: |
end for |
6: |
Q = {(<>; SDB)}; // initialize a candidate P = 〈〉 with length 0 and SDB as its projection dataset, and use a queue Q to store the pairs |
7: |
while
Q ≠ 0̸ do
|
8: |
(P, SDB∣P = Q.DeQueue(); |
9: |
if
P.L ≥ MinL
then
|
10: |
R = R ∪ P; |
11: |
end if
|
12: |
SPnext = collectSuccessors (SDB∣P, MaxI); |
13: |
CS = ST _DBSCAN(SPnext, EPS, MinPts); // cluster the spots using the modified DBSCAN algorithm |
14: |
for each C ∈ CS
do
|
15: |
Pcand = extendInstances(P, C).; // generate a candidate by appending the spots in to the instances of P
|
16: |
PS = refine(Pcand, EPS, MinPts); // PS is the set of true CB-Patterns derived from Pcand
|
17: |
for each Pnext ∈ PS
do
|
18: |
SDB∣Pnext = projecting(Pnext); |
19: |
Q.EnQueue((Pnext, SDB∣Pnext)); // add the new pair to Q
|
20: |
end for
|
21: |
end for
|
22: |
return
R; |
|