Research Article

Shortest Paths Based Web Service Selection in Internet of Things

Algorithm 4

Expanding neighbors with the same hops in BFSKNN.
BFSMapper ( ):
(1)for all   in   do
(2) emit ;
(3)end for;
(4)for all   in   do
(5) emit ;
(6)end for;
BFSReducer  (output of BFSMapper):
(7)for all     do
(8) let ;
(9)for all     do
(10)   if     then
(11)     ;
(12)   end if
(13)  end for;
(14)  emit( );
(15) end for