Determining a Least-cost Assignment