两题动态规划问题请教高手
1. Minimize z = max { f1(y1), f2(y2), f3(y3) }
s.t y1+y2+y3 = 17
y1, y2, y3 >= 0
where f1(y1) = 2y1+5, f2(y2) = y2+3, f3(y3) = y3-5
2. A company meed the following number of workers during the next 4 years
Year 1 2 3 4
# of workers 3 6 2 5
At present, the company has 5 workers. Each worker is paid $30,000 per year
At the beginning of each year, workers may be hired or fired. It costs
$10,000 to hire a worker and $25,000 to fire a worker. A newly hired worker
cannot be used to meet worker requirement until the year following the year
in which they are hired (They are paid for the year they are hired).
During each year, 1 worker quits (workers who quit do not incur any firing
cost). The number of workers have to be integer. Use dynamic programming to
determine the optimal hiring and firing schedule to minimize the total cost
incured in meeting the worker requirement in the next 4 years.