The CPM Procedure

 

Example 4.11 Nonstandard Relationships

This example shows the use of LAG variables to describe nonstandard relationships. Consider the project network in AON format. Output 4.11.1 shows the data set WIDGLAG, which contains the required project information; here the data set contains only one successor variable, requiring multiple observations for activities that have more than one immediate successor. In addition, the data set contains two new variables, lagdur and lagdurc, which are used to convey nonstandard relationships that exist between some of the activities. In the first part of the example, lagdur specifies a lag type and lag duration between activities; in the second part, the variable lagdurc specifies a lag calendar in addition to the lag type and lag duration. When multiple successor variables are used, you can specify multiple lag variables and the lag values specified are matched one-for-one with the corresponding successor variables.

Output 4.11.1 Network Data
Non-Standard Relationships
Activity Data Set WIDGLAG

Obs task days succ lagdur lagdurc
1 Approve Plan 5 Drawings    
2 Approve Plan 5 Study Market    
3 Approve Plan 5 Write Specs    
4 Drawings 10 Prototype    
5 Study Market 5 Mkt. Strat.    
6 Write Specs 5 Prototype    
7 Prototype 15 Materials ss_9 ss_9
8 Prototype 15 Facility ss_9 ss_9
9 Mkt. Strat. 10 Test Market    
10 Mkt. Strat. 10 Marketing    
11 Materials 10 Init. Prod.    
12 Facility 10 Init. Prod. fs_2 fs_2_SEVENDAY
13 Init. Prod. 10 Test Market    
14 Init. Prod. 10 Marketing    
15 Init. Prod. 10 Evaluate    
16 Evaluate 10 Changes    
17 Test Market 15 Changes    
18 Changes 5 Production    
19 Production 0      
20 Marketing 0      

Suppose that the project calendar follows a five-day work week. Recall from Example 4.6 that the project finishes on March 8, 2004. The data set, WIDGLAG, specifies that there is a 'ss_9' lag between the activities 'Prototype' and 'Materials', which means that you can start acquiring raw materials nine days after the start of the activity 'Prototype' instead of waiting until its finish time. Likewise, there is an 'ss_9' lag between 'Prototype' and 'Facility'. The 'fs_2' lag between 'Facility' and 'Init. Prod' indicates that you should wait two days after the completion of the 'Facility' task before starting the initial production. To convey the lag information to PROC CPM, use the LAG= specification in the SUCCESSOR statement. The program and the resulting output (Output 4.11.2) follow.

proc cpm data=widglag date='1dec03'd
         interval=weekday collapse out=lagsched;
   activity task;
   succ     succ / lag = (lagdur);
   duration days;
   run;

Output 4.11.2 Project Schedule: Default LAG Calendar
Non-Standard Relationships
Lag Type and Duration: Default LAG Calendar

task E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT
Approve Plan 01DEC03 05DEC03 01DEC03 05DEC03 0 0
Drawings 08DEC03 19DEC03 08DEC03 19DEC03 0 0
Study Market 08DEC03 12DEC03 13JAN04 19JAN04 26 0
Write Specs 08DEC03 12DEC03 15DEC03 19DEC03 5 5
Prototype 22DEC03 09JAN04 22DEC03 09JAN04 0 0
Mkt. Strat. 15DEC03 26DEC03 20JAN04 02FEB04 26 26
Materials 02JAN04 15JAN04 06JAN04 19JAN04 2 2
Facility 02JAN04 15JAN04 02JAN04 15JAN04 0 0
Init. Prod. 20JAN04 02FEB04 20JAN04 02FEB04 0 0
Evaluate 03FEB04 16FEB04 10FEB04 23FEB04 5 5
Test Market 03FEB04 23FEB04 03FEB04 23FEB04 0 0
Changes 24FEB04 01MAR04 24FEB04 01MAR04 0 0
Production 02MAR04 02MAR04 02MAR04 02MAR04 0 0
Marketing 03FEB04 03FEB04 02MAR04 02MAR04 20 20

Due to the change in the type of precedence constraint (from the default 'fs_0' to 'ss_9'), the project finishes earlier, on March 2, 2004, instead of on March 8, 2004 (compare with Output 4.6.1).

By default, all the lags are assumed to follow the default calendar for the project. In this case, the default project calendar has five workdays (since INTERVAL=WEEKDAY). Suppose now that the 'fs_2' lag between 'Facility' and 'Init. Prod.' really indicates two calendar days and not two workdays. (Perhaps you want to allow two days for the paint to dry or the building to be ventilated.) The variable lagdurc in the WIDGLAG data set indicates the calendar for this lag by specifying the lag to be 'fs_2_sevenday' where 'sevenday' is the name of the seven-day calendar defined in the Calendar data set, CALENDAR, displayed in Output 4.11.3. PROC CPM is invoked with LAG=lagdurc and Output 4.11.4 displays the resulting schedule. Note that the project now finishes on March 1, 2004.

Output 4.11.3 Calendar Data Set
Non-Standard Relationships
Calendar Data Set

Obs _cal_ _sun_ _mon_ _tue_ _wed_ _thu_ _fri_ _sat_
1 SEVENDAY workday workday workday workday workday workday workday

proc cpm data=widglag date='1dec03'd calendar=calendar
         interval=weekday collapse out=lagsched;
   activity task;
   succ     succ / lag = (lagdurc);
   duration days;
   run;

Output 4.11.4 Project Schedule: Lag Type, Duration, and Calendar
Non-Standard Relationships
Lag Type, Duration, and Calendar

task E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT
Approve Plan 01DEC03 05DEC03 02DEC03 08DEC03 1 0
Drawings 08DEC03 19DEC03 09DEC03 22DEC03 1 0
Study Market 08DEC03 12DEC03 12JAN04 16JAN04 25 0
Write Specs 08DEC03 12DEC03 16DEC03 22DEC03 6 5
Prototype 22DEC03 09JAN04 23DEC03 12JAN04 1 0
Mkt. Strat. 15DEC03 26DEC03 19JAN04 30JAN04 25 25
Materials 02JAN04 15JAN04 05JAN04 16JAN04 1 1
Facility 02JAN04 15JAN04 05JAN04 16JAN04 1 1
Init. Prod. 19JAN04 30JAN04 19JAN04 30JAN04 0 0
Evaluate 02FEB04 13FEB04 09FEB04 20FEB04 5 5
Test Market 02FEB04 20FEB04 02FEB04 20FEB04 0 0
Changes 23FEB04 27FEB04 23FEB04 27FEB04 0 0
Production 01MAR04 01MAR04 01MAR04 01MAR04 0 0
Marketing 02FEB04 02FEB04 01MAR04 01MAR04 20 20

In fact, you can specify an alternate calendar for all the lag durations by using the ALAGCAL= or NLAGCAL= option in the SUCCESSOR statement. The next invocation of the CPM procedure illustrates this feature by specifying ALAGCAL=SEVENDAY in the SUCCESSOR statement. Thus, all the lag durations now follow the seven-day calendar instead of the five-day calendar, which is the default calendar for this project. Output 4.11.5 shows the resulting schedule. Now the project finishes on February 27, 2004. Output 4.11.6 displays a precedence Gantt chart of the project. Note how the nonstandard precedence constraints are displayed.

 
proc cpm data=widglag date='1dec03'd calendar=calendar
         interval=weekday collapse out=lagsched;
   activity task;
   succ     succ / lag = (lagdur) alagcal=sevenday;
   duration days;
run;

pattern1 c=green v=s;     /* duration of a non-critical activity   */
pattern2 c=green v=e;     /* slack time for a noncrit. activity    */
pattern3 c=red   v=s;     /* duration of a critical activity       */

title  h=1.5   'Non-Standard Relationships';
title2 h=1 'Precedence Gantt Chart';

proc gantt graphics data=lagsched logic=widglag;
   chart / compress act=task succ=(succ) dur=days
           cprec=black cmile=blue
           caxis=black
           height=1.5 nojobnum
           dur=days increment=7 lag=(lagdur);
   id task;
   run;

Output 4.11.5 Project Schedule: LAG Calendar = SEVENDAY
Non-Standard Relationships
Lag Type and Duration: LAG Calendar = SEVENDAY

task E_START E_FINISH L_START L_FINISH T_FLOAT F_FLOAT
Approve Plan 01DEC03 05DEC03 01DEC03 05DEC03 0 0
Drawings 08DEC03 19DEC03 08DEC03 19DEC03 0 0
Study Market 08DEC03 12DEC03 09JAN04 15JAN04 24 0
Write Specs 08DEC03 12DEC03 15DEC03 19DEC03 5 5
Prototype 22DEC03 09JAN04 22DEC03 09JAN04 0 0
Mkt. Strat. 15DEC03 26DEC03 16JAN04 29JAN04 24 24
Materials 31DEC03 13JAN04 02JAN04 15JAN04 2 2
Facility 31DEC03 13JAN04 31DEC03 13JAN04 0 0
Init. Prod. 16JAN04 29JAN04 16JAN04 29JAN04 0 0
Evaluate 30JAN04 12FEB04 06FEB04 19FEB04 5 5
Test Market 30JAN04 19FEB04 30JAN04 19FEB04 0 0
Changes 20FEB04 26FEB04 20FEB04 26FEB04 0 0
Production 27FEB04 27FEB04 27FEB04 27FEB04 0 0
Marketing 30JAN04 30JAN04 27FEB04 27FEB04 20 20

Output 4.11.6 Precedence Gantt Chart
Precedence Gantt Chart