Research Article
Supporting Continuous Skyline Queries in Dynamically Weighted Road Networks
Algorithm 2
Compute the distance between two vertices in a hub graph.
input source vertex s and destination vertex t | output d(s,t) | Steps: | to reducer: | S.include(s); // define set S,add s to S | T=V-S; // set V include all vertices in the road network | while(T) | R=GetNeighborRoute(s,S,T); // find all routes between s and neighbor vertices of S in T as R | foreach r in R | if r. ConVedgeNum>=2 | R.delete(r); // if r contains more than 2 adjacent virtual edges, delete r from R | continue(); | else if r. VedgeNum>=1 | r. Vedges.get(); // if r contains virtual edge,sent this virtual edge into input cache of mapper | r.length.compute(); // compute length of r | r=R.GetShortest(); // pick the shortest route,add its ends to S | S.include(r.end); | T.delete(r.end); | if(r.end==t) // return result when reaches destination t | return r.length; | to mapper: | Vedge.get(); // get virtual edges from input cache | Vedge.length=GetLength(Vedge.id); | Vedge.sent(); // sent length of virtual edges into output cache |
|