Research Article

Shortest Paths Based Web Service Selection in Internet of Things

Algorithm 1

DijkstraKNN( ).
Input: A (weighted) graph , candidate set , nearest neighbors, and source node ;
Output: A list of from , where ;
(1)let ;
(2)let ;
(3)/*******************************************
(4)Here we redefine “ ” as follows:
(5) and
(6)*******************************************/
(7)while do
(8) DijkstraMapper ;
(9) //find a nearest neighbour
(10)      DijkstraReducer();
(11)  end while
(12)   ;
(13)  return