add a solution of all-pairs shortest path problem