Research Article
Discovering Travel Spatiotemporal Pattern Based on Sequential Events Similarity
Algorithm 3
Time similarity algorithm (TSA).
| Input: Time information t1 and t2 of travel item r1 and r2; | | Output: Time similarity Stime of r1 and r2; | (1) | Divide the time axis by half an hour, and number from 1, then t1 and t2 can be represented by digital sequence l1 and l2 | (2) | l = LCS (l1, l2) //Calculate the longest common subsequence of sequence l1 and l2 | (3) | Stime ⟵ |l|/(|l1| + |l2| − |l|) | (4) | return Stime |
|