Skip to main content
. Author manuscript; available in PMC: 2016 Jul 1.
Published in final edited form as: Int J Geogr Inf Sci. 2015 Sep 29;30(5):929–947. doi: 10.1080/13658816.2015.1091462

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 TTDB do
3: S = extractSpots(T, δG,δD); //extract the spot sequence
4: SDB = SDBS;
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, SDBP = Q.DeQueue();
9: if P.LMinL then
10:    R = RP;
11:   end if
12:   SPnext = collectSuccessors (SDBP, MaxI);
13:   CS = ST _DBSCAN(SPnext, EPS, MinPts); // cluster the spots using the modified DBSCAN algorithm
14:   for each CCS 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 PnextPS do
18:     SDBPnext = projecting(Pnext);
19:     Q.EnQueue((Pnext, SDBPnext)); // add the new pair to Q
20:   end for
21: end for
22: return R;