100% found this document useful (1 vote)
969 views7 pages

OR2 - Student Solutions

The document describes a dynamic programming problem involving allocating TV commercials across 4 areas to maximize additional votes. It provides the number of additional votes estimates for running 1-5 commercials in each area. The problem is formulated with stages being the areas, states being number of commercials, and objective of maximizing total additional votes. Dynamic programming tables are constructed moving backwards from the last area to allocate commercials optimally with the maximum votes of 18,000.

Uploaded by

SA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
969 views7 pages

OR2 - Student Solutions

The document describes a dynamic programming problem involving allocating TV commercials across 4 areas to maximize additional votes. It provides the number of additional votes estimates for running 1-5 commercials in each area. The problem is formulated with stages being the areas, states being number of commercials, and objective of maximizing total additional votes. Dynamic programming tables are constructed moving backwards from the last area to allocate commercials optimally with the maximum votes of 18,000.

Uploaded by

SA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Problem No. 10.2-3. Consider the following project network (as described in Sec. 9.

8),
where the number over each node is the time required for the corresponding activity.
Consider the problem of finding the longest path (the largest total time) through this
network from start to finish, since the longest path is the critical path.

(a) What are the stages and states for the dynamic programming formulation of this
problem?
We can consider this problem to have 5 main stages from start to finish.
The first stage is the start.
The second stage has 2 states, A or B.
The third stage has 3 states, C or D or E.
The fourth stage has 4 states, F or G or H or I.
The fifth stage has 3 states, J or K or L

However, we can simplify by combing the fourth stage with the fifth stage and adding the
time, since there is only one way to path from each node in the 4th stage to the 5th stage.

The first stage is the start.


The second stage has 2 states, A or B.
The third stage has 3 states, C or D or E.
The fourth stage has 3 states, J or K or L.

(b) Use dynamic programming to solve this problem. However, instead of using the
usual tables, show your work graphically. In particular, fill in the values of the various
fn*(sn) under the corresponding nodes, and show the resulting optimal arc to traverse out
of each node by drawing an arrowhead near the beginning of the arc. Then identify the
optimal path (the longest path) by following these arrowheads from the Start node to the
Finish node. If there is more than one optimal path, identify them all.

By using dynamic programming, we obtain the following values (nodes F, G, H, I


are added to previous nodes):
f * (J) = 0 , f * (K) = 0 , f * (L) = 0
f * (C) = 8 , f * (D) = 10 , f * (E) = 10
f * (A) = 12 , f * (B) = 13
f * (START) = 17

(c) Use dynamic programming to solve this problem by constructing the usual tables
for all n.

Constructing the tables for each stage to find f n*(s n) and x n*


n = 4:

f 4 (s 4, x 4) = c s4 x4
X4

FINISH X 4*
S4
J 0 FINISH
K 0 FINISH

L 0 FINISH

n = 3:

f 3 (s 3, x 3) = c s3 x3 + f *4 (x 3)
X3

J K L f 3* (s 3) X 3*
S3
C 6+0=6 8+0=8 - 8 K
D - 10 + 0 = 10 9+0=9 10 K

E - 10 + 0 = 10 9+0=9 10 K

n = 2:
f 2 (s 2, x 2) = c s2 x2 + f *3 (x 2)
X2

C D E f 2* (s 2) X 2*
S2
A 4 + 8 = 12 2 + 10 = 12 - 12 C or D
B - - 3 + 10 = 13 13 E
n = 1:

f 1 (s 1, x 1) = c s1 x1 + f *2 (x 1)
X1

A B f 1* (s 1) X 1*
S1
START 5 + 12 = 17 3 + 13 = 16 17 A

By following the tables forwardly, we can find the optimal solution:

X 1* =A > X 2* = C > X 3* = K > X 4* = FINISH

With alternative solution:

X 1* =A > X 2* = D > X 3* = K > X 4* = FINISH

And the longest path time (max) is 17

Problem No. 10.3-3. A college student has 7 days remaining before final examinations
begin in her four courses, and she wants to allocate this study time as effectively as
possible. She needs at least 1 day on each course, and she likes to concentrate on just one
course each day, so she wants to allocate 1, 2, 3, or 4 days to each course. Having
recently taken an OR course, she decides to use dynamic programming to make these
allocations to maximize the total grade points to be obtained from the four courses. She
estimates that the alternative allocations for each course would yield the number of grade
points shown in the following table:
Solve this problem by dynamic programming.

To solve this problem, we formulate the following programming problem:


Maximize:
∑ p n( xn )
n
Subject to:

∑ x n=7
n

xn ≥ 1

Given that number of stages, n = 1, 2, 3, 4


And X n is a non-negative integer

X n : Number of days allocated to nth stage (course)


S n: Number of days available at stage n

With the recursive relationship:


f n¿ ( S n )=max { pn ( x n ) +f n+1¿ ( S n−x n ) }

n=4
X4
f 4* (s 4) X 4*
S4
1 4 1
2 4 2

3 5 3

4 8 4

n = 3:
f 3 (s 3, x 3) = p 3 (x 3) + f *4 (s3 - x 3)
X3

1 2 3 4 f 3* (s 3) X 3*
S3
2 4+4=8 - - - 8 1

3 4+4=8 6 + 4 = 10 - - 10 2

4 4+5=9 6 + 4 = 10 7 + 4 = 11 - 11 3

5 4 + 8 = 12 6 + 5 = 11 7 + 4 = 11 9 + 4 = 13 13 1 or 4

n = 2:
f 2 (s 2, x 2) = p 2 (x 2) + f *3 (s2 - x 2)
X2

1 2 3 4 f 2* (s 2) X 2*
S2
3 5 + 8 = 13 - - - 13 1

4 5 + 10 = 15 6 + 8 = 14 - - 15 1

5 5 + 11 = 16 6 + 10 = 16 8 + 8 = 16 - 16 1 or 2 or 3

6 5 + 13 = 18 6 + 11 = 17 8 + 10 = 18 8 + 8 =16 18 1 or 3
n = 1:
f 1 (s 1, x 1) = p 1 (x 1) + f *2 (s 1 -x 1)
X1

1 2 3 4 f 1* (s 1) X 1*
S1
7 1 + 18 = 19 3 + 16 = 19 6 + 15 = 21 8 + 13 = 21 21 3 or 4

Therefor we get the following allocation of days studying each course with maximum
grades of = 21

By following the tables forwardly, we can find the optimal solution:

X 1* =3 > X 2* = 1 > X 3* = 2 > X 4* = 1

With alternative solution:

X 1* =4 > X 2* = 1 > X 3* = 1 > X 4* = 1

Problem No. 10.3-4. A political campaign is entering its final stage, and polls indicate a
very close election. One of the candidates has enough funds left to purchase TV time for
a total of five prime-time commercials on TV stations located in four different areas.
Based on polling information, an estimate has been made of the number of additional
votes that can be won in the different broadcasting areas depending upon the number of
commercials run. These estimates are given in the following table in thousands of votes:

You might also like