subject

Assume you are planning a canoe trip down a river. The river has n trading posts numbered 1 to n going downstream. You will start your trip at trading post number 1 and end at trading post number n. Let R(i, j) be the cost of renting a canoe at trading post i and returning it at trading post j, where j > i. Assume that you always want to go down river, so the costs if j ≤ i are irrelevant. Find the cheapest sequence of rentals that allow you to complete your trip. Aim for an algorithm running in O(n 2 ) time. For example, if n - 4 and the costs are: R(ij) 15 25 35 12 16 2 then the cheapest sequence of canoe rentals to travel the river would be to rent from 1 to 3, and then from 3 to 4 for a cost of 25 +5-30. On the other hand, if the costs were: 20 15 30 5 10 20 2 then taking one canoe all the way from 1 to 4 and renting 1 to 2 and then 2 to 4 are the cheapest solutions (both cost 30). (Note that renting from 1 to 3 is cheaper than going 1 to 2, but the 1 to 3 rental is not in any of the cheapest 1 to 4 solutions). Let C(k) be the cost of the cheapest sequence of canoe rentals starting from trading post 1 and returning the last canoe rented at trading post k. A. Assume an optimal sequence of rentals changes canoes at some trading post j. What subproblems are also solved optimally by (parts of) this rental sequence? B. Derive a recurrence for C(k) in terms of C(j) values where j < k. C. Give a bottom-up iterative algorithm for computing the C(j) values. D. Finally, show how keeping a little (i. e. O(n)) additional information allows the a cheapest sequence of canoe rentals to be printed out in O(n) time. For part (c), it may be helpful to first construct a recursive algorithm for computing the C(k) values.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:40
Match the personality traits with their description
Answers: 2
question
Computers and Technology, 23.06.2019 16:00
Which analyst position analyzes information using mathematical models to business managers make decisions?
Answers: 1
question
Computers and Technology, 23.06.2019 22:30
Apart from confidential information, what other information does nda to outline? ndas not only outline confidential information, but they also enable you to outline .
Answers: 1
question
Computers and Technology, 24.06.2019 12:30
Why does the pc send out a broadcast arp prior to sending the first ping request
Answers: 1
You know the right answer?
Assume you are planning a canoe trip down a river. The river has n trading posts numbered 1 to n goi...
Questions
question
English, 03.08.2019 08:30