Skip to main content
. 2022 Dec 23;23(1):130. doi: 10.3390/s23010130
Algorithm 2 Trajectory Shapley maximum coverage
Input:
   The Trajectory Shapley set M calculated by Algorithm 1,
   Trajectories set P={T1,,T|N|} in t time slot,
   Submodular distance threshold ω.
Output:
   O={N sub-trajectories}
  •    1:

    Initialize the trajectories Shapley subsets S=ϕ(Ti)ϕ(Ti)0ϕ(Ti)M

  •    2:

    Initialize the trajectories subsets K=TiTiPϕ(Ti)M

  •    3:

    Initialize segment set R={}, segment Shapley set S={}, segment distance matrix D

  •    4:

    for all trajectory Ti in P do

  •    5:

     Run approximate trajectory partitioning algorithm for Ti

  •    6:

     Add segment set Q to R

  •    7:

    for all segment Li in Q do

  •    8:

      Rerun Algorithm 1 for Li, adding ϕ(Li) to S

  •    9:

    end for

  •  10:

    end for

  •  11:

    for all segment Li in Q do

  •  12:

    for all segment Lj in Q do

  •  13:

      Calculate dLiLi,Lj and dLjLi,Lj using Equation (9).

  •  14:

      Set D(Li,Lj)=dLiLi,Lj and D(Lj,Li)=dLjLi,Lj

  •  15:

    end for

  •  16:

    end for

  •  17:

    Set D=1D(i,j)ω and D=0D(i,j)>ω

  •  18:

    Run greedy max cover algorithm and find N common patterns.

  •  19:

    return O