Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The NETDRAW Procedure

Example 5.7: Controlling the Arc-Routing Algorithm

This example illustrates the use of the DP and HTRACKS= options to control the routing of the arcs connecting the nodes. The project is a simple construction project with the following data. A Schedule data set produced by PROC CPM is input to PROC NETDRAW. The first invocation of the procedure illustrates the default layout of the network. As explained in the "Layout of the Network" section, the NETDRAW procedure uses a simple heuristic to route the arcs between the nodes. In the resulting diagram displayed in Output 5.7.1, note that the specification of BOXHT=3 limits the number of rows within each node so that the float values are not displayed.

   data exmp1;
        input task     $ 1-16
              duration
              succesr1 $ 21-33
              succesr2 $ 35-46
              succesr3 $ 48-57;
   datalines;
   Drill Well       4  Pump House
   Pump House       3  Install Pipe
   Power Line       3  Install Pipe
   Excavate         5  Install Pipe  Install Pump Foundation
   Deliver Material 2  Assemble Tank
   Assemble Tank    4  Erect Tower
   Foundation       4  Erect Tower
   Install Pump     6
   Install Pipe     2
   Erect Tower      6
   ;

   proc cpm data=exmp1 date='1jan92'd out=sched;
      activity task;
      duration duration;
      successor succesr1 succesr2 succesr3;
      run;

   title j=l h=2 ' Site: Old Well Road';
   title2 j=l h=2 ' Date: January 1, 1992';
   footnote j=r 'Default Layout ';
   proc netdraw data=sched graphics;
      actnet / act = task 
               dur = duration
               succ = (succesr1-succesr3)
               boxht = 3 xbetween = 10 
               separatearcs 
               htext=2 
               pcompress;
         run;

Output 5.7.1: Arc Routing: Default Layout
ndr7g1.gif (7392 bytes)

Next, a different routing of the arcs is obtained by specifying the DP and the HTRACKS= options. As a result of these options, the NETDRAW procedure uses a dynamic programming algorithm to route the arcs, limiting the number of horizontal tracks used to 1. The resulting network diagram is shown in Output 5.7.2. Notice that at most one arc is drawn in each horizontal track. Recall that, by default, the procedure uses a dynamic programming algorithm for arc routing if the number of tracks is restricted to be less than the maximum number of successors. Thus, for this example, the default routing option will be DP, even if it is not explicitly specified (because HTRACKS = 1 and the maximum number of successors is 3).

   footnote j=r h=1 'Controlled Layout ';
   proc netdraw data=sched graphics;
      actnet / act = task 
               dur = duration
               succ = (succesr1-succesr3)
               boxht = 3 xbetween = 10
               separatearcs
               htracks=1
               htext=2
               pcompress
               dp;
         run;

Output 5.7.2: Arc Routing: Controlled Layout
ndr7g2.gif (7455 bytes)

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.