|
Algorithm 2 Trajectory Shapley maximum coverage |
Input: The Trajectory Shapley set M calculated by Algorithm 1, Trajectories set in t time slot, Submodular distance threshold . Output: sub-trajectories}
-
1:
Initialize the trajectories Shapley subsets
-
2:
Initialize the trajectories subsets
-
3:
Initialize segment set , segment Shapley set , segment distance matrix D
-
4:
for all trajectory in
do
-
5:
Run approximate trajectory partitioning algorithm for
-
6:
Add segment set Q to R
-
7:
for all segment in Q do
-
8:
Rerun Algorithm 1 for , adding to S
-
9:
end for
-
10:
end for
-
11:
for all segment in Q do
-
12:
for all segment in Q do
-
13:
Calculate and using Equation (9).
-
14:
Set and
-
15:
end for
-
16:
end for
-
17:
Set and
-
18:
Run greedy max cover algorithm and find N common patterns.
-
19:
return O
|