Find the shortest distance for negative edge graph