refactored pregel-shortest-path