The CPM Procedure

Example 4.15 Resource Allocation

In the previous example, a summary of the resource utilization is obtained. Suppose that you want to schedule the project subject to constraints on the availability of ENGINEERS. The activity data, as in Example 4.14, are assumed to be in a data set named WIDGRES. The resource variable, engineer, specifies the number of engineers needed per day for each activity in the project. In addition to the resource engineer, a consumable resource engcost is computed at a daily rate of 200 for each unit of resource engineer used per day. The following DATA step uses the Activity data set from Example 4.14 to create a new Activity data set that includes the resource engcost.

data widgres;
set widgres;
if engineer ^= . then engcost = engineer * 200;
run;

Now suppose that the availability of the resource engineer and the total outlay for engcost is saved in a data set named WIDGRIN, displayed in Output 4.15.1.

Output 4.15.1: Resource Availability Data Set

Resource Allocation
Data Set WIDGRIN

Obs per otype engineer engcost
1 . restype 1 2
2 . suplevel 1 .
3 01DEC03 reslevel 3 40000
4 26DEC03 reslevel 4 .



In the data set WIDGRIN, the first observation indicates that engineer is a replenishable resource, while engcost is a consumable resource. The second observation indicates that an extra engineer is available, if necessary. The remaining observations indicate the availability profile starting from December 1, 2003. PROC CPM is then used to schedule the project to start on December 1, 2003, subject to the availability as specified.


proc cpm date='01dec03'd interval=weekday
         data=widgres holidata=holdata resin=widgrin
         out=widgschd resout=widgrout;
   tailnode tail;
   duration days;
   headnode head;
   holiday hol;
   resource engineer engcost / period=per obstype=otype
                               schedrule=shortdur
                               delayanalysis;
   id task;
   run;

Output 4.15.2: Resource Constrained Schedule: Rule = SHORTDUR

Resource Allocation
Resource Constrained Schedule: Rule = SHORTDUR

Obs tail head days task engineer engcost S_START S_FINISH E_START E_FINISH L_START L_FINISH R_DELAY DELAY_R SUPPL_R
1 1 2 5 Approve Plan 2 400 01DEC03 05DEC03 01DEC03 05DEC03 01DEC03 05DEC03 0    
2 2 3 10 Drawings 1 200 15DEC03 29DEC03 08DEC03 19DEC03 08DEC03 19DEC03 5 engineer  
3 2 4 5 Study Market 1 200 08DEC03 12DEC03 08DEC03 12DEC03 21JAN04 27JAN04 0    
4 2 3 5 Write Specs 2 400 08DEC03 12DEC03 08DEC03 12DEC03 15DEC03 19DEC03 0    
5 3 5 15 Prototype 4 800 30DEC03 20JAN04 22DEC03 13JAN04 22DEC03 13JAN04 0    
6 4 6 10 Mkt. Strat. . . 15DEC03 29DEC03 15DEC03 29DEC03 28JAN04 10FEB04 0    
7 5 7 10 Materials . . 21JAN04 03FEB04 14JAN04 27JAN04 14JAN04 27JAN04 0    
8 5 7 10 Facility 2 400 21JAN04 03FEB04 14JAN04 27JAN04 14JAN04 27JAN04 0    
9 7 8 10 Init. Prod. 4 800 04FEB04 17FEB04 28JAN04 10FEB04 28JAN04 10FEB04 0    
10 8 9 10 Evaluate 1 200 18FEB04 02MAR04 11FEB04 24FEB04 18FEB04 02MAR04 0    
11 6 9 15 Test Market . . 18FEB04 09MAR04 11FEB04 02MAR04 11FEB04 02MAR04 0    
12 9 10 5 Changes 2 400 10MAR04 16MAR04 03MAR04 09MAR04 03MAR04 09MAR04 0    
13 10 11 0 Production 4 800 17MAR04 17MAR04 10MAR04 10MAR04 10MAR04 10MAR04 0    
14 6 12 0 Marketing . . 18FEB04 18FEB04 11FEB04 11FEB04 10MAR04 10MAR04 0    
15 8 6 0 Dummy . . 18FEB04 18FEB04 11FEB04 11FEB04 11FEB04 11FEB04 0    



In the first invocation of PROC CPM, the scheduling rule used for ordering the activities to be scheduled at a given time is specified to be SHORTDUR. The data set WIDGSCHD, displayed in Output 4.15.2, contains the resource constrained start and finish times in the variables S_START and S_FINISH. On December 8, three activities can be scheduled, all of which require the resource engineer. Using the scheduling rule specified, PROC CPM schedules the activities with the shortest durations first; thus, the activity 'Drawings' is delayed by five working days, until December 15, 2003.

The DELAYANALYSIS option in the RESOURCE statement helps analyze the cause of the delay by adding three new variables to the Schedule data set, R_DELAY, DELAY_R, and SUPPL_R. In this example, the R_DELAY and DELAY_R variables indicate that there is a delay of five days in the activity 'Drawings' due to the resource engineer. Such information helps to pinpoint the source of resource insufficiency, if any.

Other activities that follow 'Drawings' also have S_START>E_START, but the slippage in these activities is not caused by resource insufficiency, it is due to their predecessors being delayed. The entire project is delayed by five working days due to resource constraints (the maximum value of S_FINISH is 17MAR04, while the maximum value of E_FINISH is 10MAR04).

In this invocation, the DELAY= option is not specified; therefore, the supplementary level of resource is not used, since the primary levels of resources are found to be sufficient to schedule the project by delaying some of the activities.

The data set WIDGROUT, displayed in Output 4.15.3, contains variables Rengineer and Aengineer in addition to the variables Eengineer and Lengineer. The variable Rengineer denotes the usage of the resource engineer corresponding to the resource-constrained schedule, and Aengineer denotes the remaining level of the resource after resource allocation. For the consumable resource engcost, the variables Eengcost, Lengcost, and Rengcost indicate the rate of usage per unit routinterval (which defaults to INTERVAL=WEEKDAY, in this case) at the start of the time interval specified in the variable _TIME_. The variable Aengcost denotes the amount of money available at the beginning of the time specified in the _TIME_ variable.

Output 4.15.3: Resource Usage: Rule = SHORTDUR

Resource Allocation
Usage Profiles for Constrained Schedule: Rule = SHORTDUR

O
b
s
_
T
I
M
E
_
E
e
n
g
i
n
e
e
r
L
e
n
g
i
n
e
e
r
R
e
n
g
i
n
e
e
r
A
e
n
g
i
n
e
e
r
E
e
n
g
c
o
s
t
L
e
n
g
c
o
s
t
R
e
n
g
c
o
s
t
A
e
n
g
c
o
s
t
1 01DEC03 2 2 2 1 400 400 400 40000
2 02DEC03 2 2 2 1 400 400 400 39600
3 03DEC03 2 2 2 1 400 400 400 39200
4 04DEC03 2 2 2 1 400 400 400 38800
5 05DEC03 2 2 2 1 400 400 400 38400
6 08DEC03 4 1 3 0 800 200 600 38000
7 09DEC03 4 1 3 0 800 200 600 37400
8 10DEC03 4 1 3 0 800 200 600 36800
9 11DEC03 4 1 3 0 800 200 600 36200
10 12DEC03 4 1 3 0 800 200 600 35600
11 15DEC03 1 3 1 2 200 600 200 35000
12 16DEC03 1 3 1 2 200 600 200 34800
13 17DEC03 1 3 1 2 200 600 200 34600
14 18DEC03 1 3 1 2 200 600 200 34400
15 19DEC03 1 3 1 2 200 600 200 34200
16 22DEC03 4 4 1 2 800 800 200 34000
17 23DEC03 4 4 1 2 800 800 200 33800
18 24DEC03 4 4 1 2 800 800 200 33600
19 26DEC03 4 4 1 3 800 800 200 33400
20 29DEC03 4 4 1 3 800 800 200 33200
21 30DEC03 4 4 4 0 800 800 800 33000
22 31DEC03 4 4 4 0 800 800 800 32200
23 02JAN04 4 4 4 0 800 800 800 31400
24 05JAN04 4 4 4 0 800 800 800 30600
25 06JAN04 4 4 4 0 800 800 800 29800
26 07JAN04 4 4 4 0 800 800 800 29000
27 08JAN04 4 4 4 0 800 800 800 28200
28 09JAN04 4 4 4 0 800 800 800 27400
29 12JAN04 4 4 4 0 800 800 800 26600
30 13JAN04 4 4 4 0 800 800 800 25800
31 14JAN04 2 2 4 0 400 400 800 25000
32 15JAN04 2 2 4 0 400 400 800 24200
33 16JAN04 2 2 4 0 400 400 800 23400
34 19JAN04 2 2 4 0 400 400 800 22600
35 20JAN04 2 2 4 0 400 400 800 21800
36 21JAN04 2 3 2 2 400 600 400 21000
37 22JAN04 2 3 2 2 400 600 400 20600
38 23JAN04 2 3 2 2 400 600 400 20200
39 26JAN04 2 3 2 2 400 600 400 19800
40 27JAN04 2 3 2 2 400 600 400 19400
41 28JAN04 4 4 2 2 800 800 400 19000
42 29JAN04 4 4 2 2 800 800 400 18600
43 30JAN04 4 4 2 2 800 800 400 18200
44 02FEB04 4 4 2 2 800 800 400 17800
45 03FEB04 4 4 2 2 800 800 400 17400
46 04FEB04 4 4 4 0 800 800 800 17000
47 05FEB04 4 4 4 0 800 800 800 16200
48 06FEB04 4 4 4 0 800 800 800 15400
49 09FEB04 4 4 4 0 800 800 800 14600
50 10FEB04 4 4 4 0 800 800 800 13800
51 11FEB04 1 0 4 0 200 0 800 13000
52 12FEB04 1 0 4 0 200 0 800 12200
53 13FEB04 1 0 4 0 200 0 800 11400
54 16FEB04 1 0 4 0 200 0 800 10600
55 17FEB04 1 0 4 0 200 0 800 9800
56 18FEB04 1 1 1 3 200 200 200 9000
57 19FEB04 1 1 1 3 200 200 200 8800
58 20FEB04 1 1 1 3 200 200 200 8600
59 23FEB04 1 1 1 3 200 200 200 8400
60 24FEB04 1 1 1 3 200 200 200 8200
61 25FEB04 0 1 1 3 0 200 200 8000
62 26FEB04 0 1 1 3 0 200 200 7800
63 27FEB04 0 1 1 3 0 200 200 7600
64 01MAR04 0 1 1 3 0 200 200 7400
65 02MAR04 0 1 1 3 0 200 200 7200
66 03MAR04 2 2 0 4 400 400 0 7000
67 04MAR04 2 2 0 4 400 400 0 7000
68 05MAR04 2 2 0 4 400 400 0 7000
69 08MAR04 2 2 0 4 400 400 0 7000
70 09MAR04 2 2 0 4 400 400 0 7000
71 10MAR04 0 0 2 2 0 0 400 7000
72 11MAR04 0 0 2 2 0 0 400 6600
73 12MAR04 0 0 2 2 0 0 400 6200
74 15MAR04 0 0 2 2 0 0 400 5800
75 16MAR04 0 0 2 2 0 0 400 5400
76 17MAR04 0 0 0 4 0 0 0 5000



The second invocation of PROC CPM uses a different scheduling rule (LST, which is the default scheduling rule). Ties are broken using the L_START times for the activities. In this example, this rule results in a shorter project schedule. The schedule and the resource usage data sets are displayed in Output 4.15.4 and Output 4.15.5, respectively. Once again the variables DELAY_R and R_DELAY indicate that the resource engineer caused the activity 'Study Market' ('Prototype') to be delayed by five days (three days). However, the entire project is delayed only by three working days because the activity 'Study Market' is not a critical activity, and delaying it by five days did not affect the project completion time. Even with the resource delay of 5 days, this activity is scheduled earlier (S_START=15DEC03) than its latest start time (L_START=21JAN04).

proc cpm date='01dec03'd
         interval=weekday
         data=widgres
         resin=widgrin
         holidata=holdata
         out=widgsch2
         resout=widgrou2;
   tailnode tail;
   duration days;
   headnode head;
   holiday hol;
   resource engineer engcost / period=per
                               obstype=otype
                               schedrule=lst
                               delayanalysis;
   id task;
   run;

Output 4.15.4: Resource Constrained Schedule: Rule = LST

Resource Allocation
Resource Constrained Schedule: Rule = LST

Obs tail head days task engineer engcost S_START S_FINISH E_START E_FINISH L_START L_FINISH R_DELAY DELAY_R SUPPL_R
1 1 2 5 Approve Plan 2 400 01DEC03 05DEC03 01DEC03 05DEC03 01DEC03 05DEC03 0    
2 2 3 10 Drawings 1 200 08DEC03 19DEC03 08DEC03 19DEC03 08DEC03 19DEC03 0    
3 2 4 5 Study Market 1 200 15DEC03 19DEC03 08DEC03 12DEC03 21JAN04 27JAN04 5 engineer  
4 2 3 5 Write Specs 2 400 08DEC03 12DEC03 08DEC03 12DEC03 15DEC03 19DEC03 0    
5 3 5 15 Prototype 4 800 26DEC03 16JAN04 22DEC03 13JAN04 22DEC03 13JAN04 3 engineer  
6 4 6 10 Mkt. Strat. . . 22DEC03 06JAN04 15DEC03 29DEC03 28JAN04 10FEB04 0    
7 5 7 10 Materials . . 19JAN04 30JAN04 14JAN04 27JAN04 14JAN04 27JAN04 0    
8 5 7 10 Facility 2 400 19JAN04 30JAN04 14JAN04 27JAN04 14JAN04 27JAN04 0    
9 7 8 10 Init. Prod. 4 800 02FEB04 13FEB04 28JAN04 10FEB04 28JAN04 10FEB04 0    
10 8 9 10 Evaluate 1 200 16FEB04 27FEB04 11FEB04 24FEB04 18FEB04 02MAR04 0    
11 6 9 15 Test Market . . 16FEB04 05MAR04 11FEB04 02MAR04 11FEB04 02MAR04 0    
12 9 10 5 Changes 2 400 08MAR04 12MAR04 03MAR04 09MAR04 03MAR04 09MAR04 0    
13 10 11 0 Production 4 800 15MAR04 15MAR04 10MAR04 10MAR04 10MAR04 10MAR04 0    
14 6 12 0 Marketing . . 16FEB04 16FEB04 11FEB04 11FEB04 10MAR04 10MAR04 0    
15 8 6 0 Dummy . . 16FEB04 16FEB04 11FEB04 11FEB04 11FEB04 11FEB04 0    



Output 4.15.5: Resource Usage: Rule = LST

Resource Allocation
Usage Profiles for Constrained Schedule: Rule = LST

O
b
s
_
T
I
M
E
_
E
e
n
g
i
n
e
e
r
L
e
n
g
i
n
e
e
r
R
e
n
g
i
n
e
e
r
A
e
n
g
i
n
e
e
r
E
e
n
g
c
o
s
t
L
e
n
g
c
o
s
t
R
e
n
g
c
o
s
t
A
e
n
g
c
o
s
t
1 01DEC03 2 2 2 1 400 400 400 40000
2 02DEC03 2 2 2 1 400 400 400 39600
3 03DEC03 2 2 2 1 400 400 400 39200
4 04DEC03 2 2 2 1 400 400 400 38800
5 05DEC03 2 2 2 1 400 400 400 38400
6 08DEC03 4 1 3 0 800 200 600 38000
7 09DEC03 4 1 3 0 800 200 600 37400
8 10DEC03 4 1 3 0 800 200 600 36800
9 11DEC03 4 1 3 0 800 200 600 36200
10 12DEC03 4 1 3 0 800 200 600 35600
11 15DEC03 1 3 2 1 200 600 400 35000
12 16DEC03 1 3 2 1 200 600 400 34600
13 17DEC03 1 3 2 1 200 600 400 34200
14 18DEC03 1 3 2 1 200 600 400 33800
15 19DEC03 1 3 2 1 200 600 400 33400
16 22DEC03 4 4 0 3 800 800 0 33000
17 23DEC03 4 4 0 3 800 800 0 33000
18 24DEC03 4 4 0 3 800 800 0 33000
19 26DEC03 4 4 4 0 800 800 800 33000
20 29DEC03 4 4 4 0 800 800 800 32200
21 30DEC03 4 4 4 0 800 800 800 31400
22 31DEC03 4 4 4 0 800 800 800 30600
23 02JAN04 4 4 4 0 800 800 800 29800
24 05JAN04 4 4 4 0 800 800 800 29000
25 06JAN04 4 4 4 0 800 800 800 28200
26 07JAN04 4 4 4 0 800 800 800 27400
27 08JAN04 4 4 4 0 800 800 800 26600
28 09JAN04 4 4 4 0 800 800 800 25800
29 12JAN04 4 4 4 0 800 800 800 25000
30 13JAN04 4 4 4 0 800 800 800 24200
31 14JAN04 2 2 4 0 400 400 800 23400
32 15JAN04 2 2 4 0 400 400 800 22600
33 16JAN04 2 2 4 0 400 400 800 21800
34 19JAN04 2 2 2 2 400 400 400 21000
35 20JAN04 2 2 2 2 400 400 400 20600
36 21JAN04 2 3 2 2 400 600 400 20200
37 22JAN04 2 3 2 2 400 600 400 19800
38 23JAN04 2 3 2 2 400 600 400 19400
39 26JAN04 2 3 2 2 400 600 400 19000
40 27JAN04 2 3 2 2 400 600 400 18600
41 28JAN04 4 4 2 2 800 800 400 18200
42 29JAN04 4 4 2 2 800 800 400 17800
43 30JAN04 4 4 2 2 800 800 400 17400
44 02FEB04 4 4 4 0 800 800 800 17000
45 03FEB04 4 4 4 0 800 800 800 16200
46 04FEB04 4 4 4 0 800 800 800 15400
47 05FEB04 4 4 4 0 800 800 800 14600
48 06FEB04 4 4 4 0 800 800 800 13800
49 09FEB04 4 4 4 0 800 800 800 13000
50 10FEB04 4 4 4 0 800 800 800 12200
51 11FEB04 1 0 4 0 200 0 800 11400
52 12FEB04 1 0 4 0 200 0 800 10600
53 13FEB04 1 0 4 0 200 0 800 9800
54 16FEB04 1 0 1 3 200 0 200 9000
55 17FEB04 1 0 1 3 200 0 200 8800
56 18FEB04 1 1 1 3 200 200 200 8600
57 19FEB04 1 1 1 3 200 200 200 8400
58 20FEB04 1 1 1 3 200 200 200 8200
59 23FEB04 1 1 1 3 200 200 200 8000
60 24FEB04 1 1 1 3 200 200 200 7800
61 25FEB04 0 1 1 3 0 200 200 7600
62 26FEB04 0 1 1 3 0 200 200 7400
63 27FEB04 0 1 1 3 0 200 200 7200
64 01MAR04 0 1 0 4 0 200 0 7000
65 02MAR04 0 1 0 4 0 200 0 7000
66 03MAR04 2 2 0 4 400 400 0 7000
67 04MAR04 2 2 0 4 400 400 0 7000
68 05MAR04 2 2 0 4 400 400 0 7000
69 08MAR04 2 2 2 2 400 400 400 7000
70 09MAR04 2 2 2 2 400 400 400 6600
71 10MAR04 0 0 2 2 0 0 400 6200
72 11MAR04 0 0 2 2 0 0 400 5800
73 12MAR04 0 0 2 2 0 0 400 5400
74 15MAR04 0 0 0 4 0 0 0 5000