HW2solution - HW #3 Problem 1 Idea of solution The problem...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: HW #3 Problem 1 Idea of solution The problem had a bit more complexity that we initially realized. To see this, note the following: Suppose we can get to some intermediate node j in 8 days for $380 or in 9 days for $340. Which one is better? The problem is, we do not know (yet). The additional day might be irrelevant or it might become very costly (additional $200) if it ends up requiring to rent the car for an additional week. The above reasoning suggests that, for node j , we need to keep track of more than just the length of the cheapest (1 ,j ) path. This can be addressed by introducing a state variable standing for the number of days available for the journey. The idea of the solution follows. Notation: We denote c ij the cost (in dollars) of arc ( i,j ) and ij the length (in days) of arc ( i,j ). Optimal value function definition: Let us denote f * j ( d ) = minimum cost of getting from node 1 to node j in at most d days . Recursive formula: For any node j , we want to find optimal next-to-last node on the cheapest (1 ,j ) path. Consider node i . Then the cost of the cheapest (1 ,j ) path through node i (as paths next-to-last node) of length at most d days is given by min d i : d i + 1 ( i> 1)+ ij d f * i ( d i ) + c ij + 200 ( b ( d i + 1 ( i > 1) + ij ) / 7 c -b d i / 7 c ) . In the above formula, note that f * i ( d i ) stands for the cost of the cheapest (1 ,i ) path of length at most d i days. c ij is the cost of ( i,j ) arc. ( b ( d i + 1 ( i > 1) + ij ) / 7 c - b d i / 7 c ) gives the number of additional weeks (for which we have to pay $200 per week) started by adding days d i +1 ,d i +2 ,...,d i + ij + 1 ( i > 1) to the path. (Note that for i = 1, the term 1 ( i > 1) equals 0. This reflects the fact that we are not staying for an additional day in node 1.) Since we are looking for path of at most d days, we optimize over all possible d i s such that d i + 1 ( i > 1) + c ij d . (Recall that we are required to stay 1 day in each intermediate node. Hence the term 1 ( i > 1).) Having evaluated minimum cost when using i as a next-to-last node, we are ready to formulate the recursive formula for node j . We have f * j ( d ) = min i : ( i,j ) E min d i : d i + 1 ( i> 1)+ ij d n f * i ( d i ) + c ij + 200 ( b ( d i + 1 ( i > 1) + ij ) / 7 c -b d i / 7 c ) o . Solution process: Starting with the boundary condition f * 1 ( d ) = 0 for any d 0 calculate recursively the values of f * 2 ( ) ,...,f * 10 ( ). Then, min d f * 10 ( d ) will give the minimum cost of the cheapest (1 , 10) path. Also, arg min d f * 10 ( d ) will give the number of days this cheapest path takes. You can find out the optimal path by backtracking the optimizers in each step along the path....
View Full Document

Page1 / 12

HW2solution - HW #3 Problem 1 Idea of solution The problem...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online