Calcualte neighbors first, and then do usual bfs search. for visited vertices, if the distance is no larger ,still has to put it into the queue. Finally, this version AC.