leastCostMatrix function

Computes a least cost matrix from a distance matrix.