finished computing cost matrix between point pairs