min cost problem using Goldberg CS2