Sssp algorithm version 3