Dynamic Programming : Write an Algorithm to Minimize Cost
There are n trading posts along a river. At any of the posts you can rent a canoe to be returned at any other post downstream. (It is next to impossible to paddle against the current.) For each possible departure point i and each possible arrival point j the cost of a rental from i to j is known. However, it can happen that the cost of renting for i to j is higher that the total cost of a series of shorter rentals. In this case you can return the first canoe at some post k between i and j and continue your journey in a second canoe. There is no extra charge for changing canoes in this way.
Give an efficient algorithm to determine the minimum cost of a trip by canoe for each possible departure point i to each possible arrival point j. In terms of n, how much time is needed by your algorithm?
Solution Preview
Let c(i,j) be the cost of a rental directly from i to j. From the condition, it is impossible to paddle against the current. So we always assume i<=j in c(i,j). Moreover, c(i,i)=0.
Suppose the function MinCost(i,j) outputs the minimum cost of a trip by canoe from i to j with (i<=j). We know, ...
... at: cwo@gsb.stanford.edu or write: Case Writing... ability to react to a dynamic competitive landscape. ... former, MIS, was responsible for programming the computer ...
... analysis and presentation, advertisement copy writing, and project ... has examined "emotional branding, a dynamic cocktail of ... of the state's Grant Program for the ...
... where he wrote, 'Do not undertake the program waste) unless ... re not in the business to write the most ... for its state- theorizing on the dynamics of capabilities ...
... technologies are now developing may be so dynamic that institutions ... that a contract offer be in writing or that ... be found lies in the initial programming of the ...
... clustering is more effective for dynamic (read/write... by the Internet Server Application Programming Interface (ISAPI ... To write the custom code, do the following: ...
... teach them more about the dynamic behavior of a ... courses (eg, introductory fluid dynamics courses that ... design a college-wide instructional program in engineering ...
... take other action.122 Under the program, the FDA ... For example, according to the Center for Disease Dynamics,. ... meeting patients' demands is as easy as writing a. ...
... Once you've identified it, write a persuasive memo ... a of devising highly ef- powerful dynamic, What, then ... gy behind an innovative tutorial program will jump on ...
... within the inpatient mental health program (not DEVELOPMENT ... sourcing of funding for this dynamic new role ... Geneva: World Health Organization, and writing of the ...