* return cost >= 0