Research Article
Semantic-Aware Top-k Multirequest Optimal Route
Algorithm 3
Priority(Q,D,S).
Input: Request: ; : the number of services; | |
Priority dictionary: D(keyword, priority); initialize S=Q; | |
Output: priority set | |
1 n=1, , , t=0, , ; | |
2 if ==N then | |
3 for in Q do | |
4 if (Q-)∩. then | |
5 HQ= (Q-)∩.D | |
6 t=max(HQ.priority) | |
7 if .priority then | |
8 .priority=1 | |
9 else | |
10 .priority=0 | |
11 else | |
12 .priority=1 | |
13 QH.add(,.priority) | |
14 for in QH do | |
15 if .priority==1 then | |
16 set.add() | |
17 pre_set←set; | |
18 ; | |
19 else | |
20 r’=pre_set-S; | |
21 HQ=(Q- r’)∩r’.D; | |
22 if then | |
23 t=max(HQ.priority) | |
24 for r in HQ do | |
25 if r.priority==t then | |
26 S.add(r) | |
27 pre_set←S; | |
28 set←pre_set; | |
29 return set; |