Research Article

Context Prediction of Mobile Users Based on Time-Inferred Pattern Networks: A Probabilistic Approach

Algorithm 1

Pseudocode for constructing a TIPN after preprocessing.
Start with an empty TIPN composed of isolated nodes;
For   to   // read input context data
 // constructing type-I nodes and their edges
for   to  
  Update info of type-I node ;
  if type-I node belongs to then
   Update edge ;
 // constructing type-II nodes and their edges
for   to
  if context type of context type of then
   for   to  
    if type-I node belongs to then
     Update info of type-II node ;
     Update edge ;
 // constructing type-III nodes and their edges
for   to  
  if   a type-III node starting with the node then
   for   to  
    if type-I node belongs to then
     Update info of type-III node ;
     Update edge ;