add a few more standard functions
compute only upper half of cost matrix