Added an additional optimization to sssp.