The NETDRAW Procedure

Example 7.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 section "Layout of the Network", the NETDRAW procedure uses a simple heuristic to route the arcs between the nodes. In the resulting diagram displayed in Output 7.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; 
       format task $16. succesr1-succesr3 $16. ; 
       input task & 
             duration 
             succesr1 & 
             succesr2 & 
             succesr3 & ; 
       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='1jan04'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, 2004'; 
    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 7.7.1: Arc Routing: Default Layout
ndr7g1.gif (20809 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 7.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 7.7.2: Arc Routing: Controlled Layout
ndr7g2.gif (20895 bytes)

Previous Page | Next Page | Top of Page