Skip to main content
. 2018 Nov 22;18(12):4093. doi: 10.3390/s18124093
Algorithm 2. Transportation Events Alignment and Fusion
Input:Tw,Tn,WEweibo, WEnews
Output: AlignedTopicsList, FusionEventMatrix
//Step 1: aligning the topic clusters inTwandTn, return AlignedTopicsList
 For each Tw(i) in Tw
  WeiboIndex = i
  For each Tn(j) in Tn
   If μR*(Tw(i),Tn(j))<minTopicDis
   minTopicDis = μR*(Tw(i),Tn(j))
   NewsAlignedIndex = j
 End for // Find the closest topic cluster
 Append (WeiboIndex, NewsAlignedIndex) to AlignedTopicsList
 End for // couple closet the topic clusters into pairs
//Step 2: fusing the words in the cross-paired topics, return FusionEventMatrix
 For each index pair in AlignedTopicsList
  i = WeiboIndex;
  j = NewsAlignedIndex
  LBn = μR*(Tw(i),Tn(j))  σR*(Tw(i),Tn(j))
   UBw = μR*(Tw(i),Tn(j)) + σR*(Tw(i),Tn(j)) // calculate the low boundary and up boundary for news words
  LBw = μR*(Tw(i),Tn(j))3σR*(Tw(i),Tn(j))
  UBw = μR*(Tw(i),Tn(j)) + 3σR*(Tw(i),Tn(j)) // calculate the low boundary and up boundary for weibo words
  For each WEw(m,i) in Tw(i)
   For each WEn(n,j) in Tn(j)
    If disR(WEw(m,i),WEn(n,j)) < minWordDis
    minWordDis = disR(WEw(m,i),WEn(n,j))
    minWordIndex = n
   End for // Find the shortest word embedding distance in coupled clusters
   If LBw < minWordDis < UBw // remove anomaly word in Weibo cluster
    If LBn < minWordDis < UBn
     Append WEn(minWordIndex,j) to FusionEventList // append words in News cluster
    Else
    Append WEw(m,i) to FusionEventList // append words in Weibo cluster
  End for
  Append FusionEventList to FusionEventMatrix
 End for