added a function calculating all shortest paths