AMPL/MathProg constraints for the "loose cash" puzzle -
AMPL/MathProg constraints for the "loose cash" puzzle -
i seek formulate h.e. dudeney's "loose cash" problem in ampl/mathprog code.
challenge "loose cash" problem:
what largest sum of money-all in current coins , no silver dollars-that have in pocket without beingness able give alter dollar, half dollar, quarter, dime, or nickel?
problem approach incomplete:
set coins; param value{t in coins}; var number{t in coins}, integer, >=0; subject ... maximize money_value: sum{t in coins} number[t] * value[t]; data; param: coins: value := penny 1 nickel 5 dime 10 quarter 25 half 50; end;
question: how formulate constraints section ...
properly?
ampl mathprog
Comments
Post a Comment