Research Article

Recommending Locations Based on Users’ Periodic Behaviors

Algorithm 3

Mining periods.
Input: matrix
  st
  map
  T
  S
Output: periods
Begin
(1) periods =
(2) for t1 in T do
(3) for t2 in T do
(4)    = matrix[t1][t2]
(5)   If  ! = 0 and        do
(6)      = t1
(7)     
(8)     hitting_count = 0
(9)     while        do
(10)        If    in    and    in    do
(11)      hitting_count++
(12)     end
(13)     
(14)     
(15)    end
(16)   If  support_sp(hitting_count, t1, p, len(S)) st do
(17)      PeriodObject(p, t1))
(18)     DynamicChangeMatrix(matrix, t1, t2,T)
(19)   end
(20) end
(21) end
end