Research Article

Semantic-Aware Top-k Multirequest Optimal Route

Algorithm 1

KOR-SP(G,s,Q,k).

Input: Graph: G(V,E); Request: ; number of routes: K;
Output: top-k routes
1  , initialize and ;
2 ΨØ;
3 priority queue ;
4 while R is not empty and do
5  P=(,x)R.extractMin();
6  
7  if then
8   ΨΨU;
9   for each i=1,…,q-1 do
10    if QRP()=QRP(.getValue())
11     then
12       P’=(,-) .getValue().extractMin();
13       R.insert(P’);
14       .remove();
15  else
16   if QRP(p)=QRP () then
17    .add;
18    NN(,QPR(Q-Q’),1);
19    R.insert((,1));
20   else
21    .add(,P);
22   if q>0 then
23    NN(,PRQ(R-QRP()),x+1);
24    R.insert((,x+1));
25 return Ψ;