Dynamic Programming Exercises Guide
Dynamic Programming Exercises Guide
B 7 E 1 H
4 3
2 4
6
3 6
A 4 C 2 F J
4 3
3
4
4 1 3
D 5 G 3 I
The distances of the different paths (in hundreds of kilometers) are indicated on the
arcs of the figure. The traveler wishes to find the route that minimizes the distance to
travel between the cities A and J.
The paths that connect the bases of the three mountains are of:
We started the first day at the base of Cerro La Campana and returned to it.
place in 5 days, our goal was to walk as many kilometers as
we could. We also decided to climb exactly one mountain each day and
camping at the base of the mountain where we would make the ascent the next day.
In addition, we decided that we could not visit the same mountain two days in a row.
consecutive.
3.- A hiker in the woods must pack three items: food, equipment for
first aid and clothing. The backpack has a capacity of 3 m.3Each unit of
food occupies 1 m3A first aid kit takes up a quarter of 1 m.3
and each piece of clothing takes up about half a meter3.
The hiker assigns priority weights 3, 4, and 5 to the food items, the backpack.
first aid and clothing, which means that clothing is the most valuable of the 3
articles. From experience, the hiker knows that they should carry at least one
unit of each item and no more than two first aid kits.
The committee in charge assigns a rating to each application, based on various factors.
factors. A higher rating means more need. For the next six
In the months, the Rautén organization can count on a maximum of 23 volunteers.
The following data summarizes the ratings of the applications and the number
volunteers needed
The total capital available for the construction of the device is $10,000.
How should the device be built?
Suggestion: the goal is to maximize reliability, r1, r2y r3of the device. This
it means that the decomposition of the objective function is of multiplication, plus
what a sum.
The measure of efficiency will be taken in terms of additional years of life for
For a specific country, this measure is equal to the increase in the average
expected life in years, multiplied by its population). In the following table, it
and gives the estimates of these additional years of life per person (in multiples of
1000) for each country and for each possible number of assigned medical brigades.
Thousands of additional person-years of life
Number of medical brigades Country 1 Country 2 Country 3
0 0 0 0
1 45 20 50
2 70 45 70
3 90 75 80
4 105 110 100
5 120 150 130
It is desired to establish the allocation that maximizes the measure of efficiency.
Based on the information from the preliminary surveys, an estimation was made.
of the additional votes that can be gained in the different areas of
dissemination according to the number of commercials that are purchased. These estimates are given
in the following table, in thousands of votes.
9.- A road repair contractor estimates that the number of workers needed
During the next 5 weeks, there will be: 8, 4, 7, 8 and 2 workers, respectively. The
The excess of workers that remains in the workforce will cost $3000 for each
worker and for each week. Meanwhile, the new hires in any
per week incur a fixed cost of $4000 plus $2000 per worker and per week.
In addition, a severance payment of $100 is incurred for each dismissed worker.
Recommend to the contractor the effective number of workers for each of the 5
weeks, solving using dynamic programming.
Alex Staffa can choose not to return the rented cars at the end of the week,
in which case the agency will only be responsible for the weekly rent (US$ 220)
What is the best way for Alex Staffa to resolve car rental?
11.- A company needs to determine the replacement policy for a machine,
during the next 4 years (n = 4), that is until the beginning of year 5. the following
table provides the data of the problem. The company requires that a machine of
six years is replaced. The cost of a new machine is UF$ 1000.
The determination of: the utility of the machine, the operating cost of the machine
and the salvage value of the machine depends on the t years of age that it has
machine. The relevant information is shown in the following table:
Edad, t(años) Utilidad, r(t) Costo de operación, r(t) Valor de rescate, s(t)
0 US$ 200 UF$ 2
1 UF$ 190 UF$ 6 US$ 800
2 UF$ 185 UF$ 12 UF$ 600
3 UF$ 172 UF$ 15 UF$ 500
4 UF$ 155 UF$ 17 UF$ 300
5 UF$ 140 UF$ 18 UF$ 100
6 UF$ 122 UF$ 22 USD 50
Develop the network of feasible values for the age of the machine in each year and
find the optimal solution for the equipment replacement model, if:
The production cost per unit is $1 for the first 6 units and $2 for
the additional units.
The production cost per unit is $10 for the first 3 units and $20
for each additional unit.
For each of the two following cases (cases C and D), determine the ranges.
feasible for Z1, Z2, X1, X2y X3:
In the second column of the following table, the number of engines is indicated.
they must be ready for installation in order to meet the delivery dates
contracted. Thus, the cumulative number of engines that must be produced by the end
For months 1, 2, 3, and 4, it must be at least 10, 25, 50, and 70, respectively.
The facilities available for producing the engines vary according to others.
production, maintenance, and renewal programs during this period. The
monthly differences that result in the maximum number that can be
produce and the unit cost of production (in millions of $) are given in the third and
fourth column of the preceding table.
16.-You wish to invest the following amounts in the next 4 years P 1= 5000, P2
= 4000, P3= 3000 and P4= 2000. You can invest in two banks. The first bank pays
an annual compound interest rate of 8.5% and the percentages of the bonuses
over the next four years are 1.8; 1.7; 2.1 and 2.5; respectively. The rate
the compound annual interest offered by the second bank is 8%, but its
The bonus is 0.5% higher than that of the first bank.