It now calculates first fase of shortests paths (only stage 0 distance matrix)