Algorithm 4.
Require: Original dataset D, trajectory W, integer n specifying the number of trajectories to be included in the cluster | |
Return: Cluster C, ILM(C) and ALM(C) | |
1: | D ← D \ {W}; W̃ ← W; i′ ← 0; a′ ← 0 |
2: | for all j ∈ [1, (n − 1)] do |
3: | Z ← argminT∈D {(i + a)|i, a ∈ A-GS(W̃, i′, a′, T)} ▷Align W̃ with Z, the closest trajectory to W̃ |
4: | {T̃, i, a} ← A-GS(W̃, i′, a′, Z) |
5: | D ← D \ {Z}; W̃ ← T; i′ ← i; a′ ← a |
6: |
end for ▷Form a cluster of anonymized trajectories |
7: | C ← the set containing n copies of W̃ |
8: | return {C, i′, a′} |