{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

HW3_solution

# HW3_solution - solution of homework 3 Problem 1 P1 = 4,P2 =...

This preview shows pages 1–3. Sign up to view the full content.

solution of homework 3 Problem 1 P 1 = 4, P 2 = 5, P 3 = 2 f (0) = 0 f (1) = P 3 + f (1 - 1) = 2 f (2) = P 3 + f (2 - 1) = 4 f (3) = max ( P 1 + f (3 - 3) , P 3 + f (3 - 1)) = max (4 , 6) = 6 f (4) = max ( P 1 + f (4 - 3) , P 2 + f (4 - 4) , P 3 + f (4 - 1)) = max (6 , 5 , 8) = 8 f (5) = max ( P 1 + f (5 - 3) , P 2 + f (5 - 4) , P 3 + f (5 - 1)) = max (8 , 7 , 10) = 10 f (6) = max ( P 1 + f (6 - 3) , P 2 + f (6 - 4) , P 3 + f (6 - 1)) = max (10 , 9 , 12) = 12 f (7) = max ( P 1 + f (7 - 3) , P 2 + f (7 - 4) , P 3 + f (7 - 1)) = max (12 , 11 , 14) = 14 f (8) = max ( P 1 + f (8 - 3) , P 2 + f (8 - 4) , P 3 + f (8 - 1)) = max (14 , 13 , 16) = 16 f (9) = max ( P 1 + f (9 - 3) , P 2 + f (9 - 4) , P 3 + f (9 - 1)) = max (16 , 15 , 18) = 18 f (10) = max ( P 1 + f (10 - 3) , P 2 + f (10 - 4) , P 3 + f (10 - 1)) = max (18 , 17 , 20) = 20 f (11) = max ( P 1 + f (11 - 3) , P 2 + f (11 - 4) , P 3 + f (11 - 1)) = max (20 , 19 , 22) = 22 f (12) = max ( P 1 + f (12 - 3) , P 2 + f (12 - 4) , P 3 + f (12 - 1)) = max (22 , 21 , 24) = 24 f (13) = max ( P 1 + f (13 - 3) , P 2 + f (13 - 4) , P 3 + f (13 - 1)) = max (24 , 23 , 26) = 26 f (14) = max ( P 1 + f (14 - 3) , P 2 + f (14 - 4) , P 3 + f (14 - 1)) = max (26 , 25 , 28) = 28 f (15) = max ( P 1 + f (15 - 3) , P 2 + f (15 - 4) , P 3 + f (15 - 1)) = max (28 , 27 , 30) = 30 So the optimal solution is x ? 1 = 0, x ? 2 = 0, x ? 3 = 15. The maximum value of the objective function is 30. Problem 2 By using Dijkstra’s algorithm, we can get the longest distance from Node 0 to Node 15 is 30. 1

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

View Full Document
Problem 3 Let us define the following three functions: f ( x ) = max 3 x 2 1 + 5 x 2 + x 3 3 , s.t.3 x 1 + 4[ x 2 ] + x 2 3 x ; x i are nonnegative integers g ( x ) = max 3 x 2 1 + 5 x 2 , s.t.3 x 1 + 4[ x 2 ] x ; x i are nonnegative integers h ( x ) = max 5 x 2 , s.t.4[ x 2 ] x ; x i are nonnegative integers Then we could get: h ( x
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}