Output: L
 num = 0; //the appearing number of the starting position
; //get the starting position
 for each in L:
  if () then
   if (num >1) then
    break; //break when the starting position appears//at the second time
 if ( ) then //L is equivalent to formula (12)
   ; //there is cross or ring and delete the//staring position
   return L;
  return L; //if without intersection or ring, return L directly
 Therefore, after improvement, the work process of the k-anonymity algorithm on the new architecture of AS in Section 4.2 is as follows.
(3)The user originates request to AS and sends to it.
(4)CS receives the request and forwards it to TPS.
(5)TPS performs the k-anonymity algorithm: ① find k-1 users in the range of and ; ② originate the request of planning path from to to MNS and sends to it; ③ receive the route and location guidance information from MNS; ④ call Algorithm 1 to judge whether the user meets the conditions and decide whether to include it in k users or not; ⑤ after collecting k users, call the location cloaking algorithm, obtain the position of the center of the cloaked area , and create a set which is composed of the query contents of k users and ; ⑥ send the message to CS, and CS will forward to LBS; ⑦ receive the query result from LBS, in which , , denoting the route from to and represents the guidance information of the route; ⑧ call Algorithm 2 to handle the intersection or ring and send the final result to , in which is the result returned from Algorithm 2 and is the guidance information corresponding to .
(6)The user starts navigation according to and .
(7)If the current position deviates the path , it will rerequest to plan route and go to step 1.
Algorithm 2: HandleIntersectionOrRing //according to the last two cases.