The OPTGRAPH Procedure

Example 1.4 Betweenness and Closeness Centrality for Project Groups in a Research Department

This example uses the same data as are used in the section Influence Centrality for Project Groups in a Research Department, which illustrates influence centrality by considering the link weights that represent some measure of reporting magnitude. In Influence Centrality for Project Groups in a Research Department, links between managers (or leads) and direct reports had higher link weights than links between non-managers. This interpretation makes sense in the context of influence centrality because weight and the metric are directly related. However, weight and the metric are inversely related for closeness and betweenness centrality.

This example considers the speed of the flow of information between people. In this sense, connections between managers and direct reports have smaller values, which cost less in the shortest path calculations. The following DATA step produces a new links data set, based on LinkSetInDept, which uses the inverse of the weight:

data LinkSetInDeptInv;
   set LinkSetInDept;
   weight = 1 / weight;
run;

The following statements calculate weighted (and unweighted) closeness and betweenness centrality. Notice that this example also uses the NTHREADS= option in the PERFORMANCE statement to specify two threads to allow the computation to be run in parallel. Since these data have 18 nodes, each thread can process 9 nodes simultaneously.

proc optgraph
   loglevel     = moderate
   data_links   = LinkSetInDeptInv
   out_links    = LinkSetOut
   out_nodes    = NodeSetOut;
   performance
      nthreads  = 2;
   centrality
      close     = both
      between   = both;
run;
%put &_OPTGRAPH_;
%put &_OPTGRAPH_CENTRALITY_;

The progress of the procedure is shown in Output 1.4.1.

Output 1.4.1: PROC OPTGRAPH Log: Closeness and Node Betweenness Centrality for Project Groups in a Research Department

NOTE: ------------------------------------------------------------------------------------------
NOTE: ------------------------------------------------------------------------------------------
NOTE: Running OPTGRAPH version 14.1.                                                            
NOTE: ------------------------------------------------------------------------------------------
NOTE: ------------------------------------------------------------------------------------------
NOTE: The OPTGRAPH procedure is executing in single-machine mode.                               
NOTE: ------------------------------------------------------------------------------------------
NOTE: ------------------------------------------------------------------------------------------
NOTE: Reading the links data set.                                                               
NOTE: There were 35 observations read from the data set WORK.LINKSETINDEPTINV.                  
NOTE: Data input used 0.01 (cpu: 0.00) seconds.                                                 
NOTE: Building the input graph storage used 0.00 (cpu: 0.00) seconds.                           
NOTE: The input graph storage is using 0.3 MBs of memory.                                       
NOTE: The number of nodes in the input graph is 18.                                             
NOTE: The number of links in the input graph is 35.                                             
NOTE: ------------------------------------------------------------------------------------------
NOTE: ------------------------------------------------------------------------------------------
NOTE: Processing centrality metrics.                                                            
NOTE: ------------------------------------------------------------------------------------------
NOTE: Processing weighted between/close centrality metrics using 2 threads.                     
                                                     Cpu     Real                               
      Algorithm                Nodes   Complete     Time     Time                               
      betwNL/close(wt)            18       100%     0.00     0.00                               
NOTE: Processing centrality metrics used 0.1 MBs of memory.                                     
NOTE: Processing weighted between/close centrality metrics used 0.00 (cpu: 0.00) seconds.       
NOTE: ------------------------------------------------------------------------------------------
NOTE: Processing unweighted between/close centrality metrics using 2 threads.                   
                                                     Cpu     Real                               
      Algorithm                Nodes   Complete     Time     Time                               
      betwNL/close(unwt)          18       100%     0.00     0.00                               
NOTE: Processing centrality metrics used 0.1 MBs of memory.                                     
NOTE: Processing unweighted between/close centrality metrics used 0.00 (cpu: 0.00) seconds.     
NOTE: ------------------------------------------------------------------------------------------
NOTE: Processing centrality metrics used 0.00 (cpu: 0.00) seconds.                              
NOTE: ------------------------------------------------------------------------------------------
NOTE: ------------------------------------------------------------------------------------------
NOTE: Creating nodes data set output.                                                           
NOTE: Creating links data set output.                                                           
NOTE: Data output used 0.00 (cpu: 0.00) seconds.                                                
NOTE: ------------------------------------------------------------------------------------------
NOTE: ------------------------------------------------------------------------------------------
NOTE: The data set WORK.LINKSETOUT has 35 observations and 5 variables.                         
NOTE: The data set WORK.NODESETOUT has 18 observations and 5 variables.                         
STATUS=OK  CENTRALITY=OK                                                                        
STATUS=OK  CPU_TIME=0.00  REAL_TIME=0.00                                                        



The node data set NodeSetOut shows the weighted and unweighted closeness and node betweenness centrality, as shown in Output 1.4.2.

Output 1.4.2: Closeness and Betweenness Centrality for Project Groups in a Research Department

node centr_close_wt centr_close_unwt centr_between_wt centr_between_unwt
Yu 0.87179 0.50000 0.50000 0.41262
Chapman 0.88696 0.50000 0.44118 0.23235
Gotti 0.81600 0.51515 0.20956 0.28444
Oliver 0.73913 0.44737 0.04044 0.02230
Snopp 0.75556 0.38636 0.16176 0.08088
Gukrishnan 0.46575 0.32692 0.00000 0.00000
Leon 0.50746 0.38636 0.00000 0.03885
Kabutz 0.50746 0.38636 0.00000 0.03885
Patrick 0.50000 0.37778 0.00000 0.00000
Zhuo 0.58286 0.47222 0.06618 0.15172
Polark 0.69388 0.38636 0.30882 0.30882
Chang 0.44156 0.29310 0.00000 0.00000
Angel 0.44156 0.29310 0.00000 0.00000
Weng 0.44156 0.29310 0.00000 0.00000
Christoph 0.68456 0.48571 0.05882 0.11275
Nardo 0.51777 0.42500 0.00000 0.00000
Graffe 0.67105 0.43590 0.08088 0.06642
Hund 0.45133 0.36957 0.00000 0.00000



The link data set LinkSetOut shows the weighted and unweighted link betweenness centrality, as shown in Output 1.4.3.

Output 1.4.3: Link Betweenness Centrality for Project Groups in a Research Department

from to weight centr_between_wt centr_between_unwt
Yu Chapman 0.33333 0.39706 0.25576
Gotti Chapman 0.33333 0.20221 0.09767
Oliver Chapman 0.33333 0.14338 0.07623
Snopp Chapman 0.33333 0.26471 0.16005
Gukrishnan Leon 1.00000 0.00735 0.03431
Snopp Gukrishnan 1.00000 0.11029 0.05637
Kabutz Gukrishnan 1.00000 0.00735 0.03431
Kabutz Snopp 1.00000 0.03676 0.03517
Snopp Leon 1.00000 0.03676 0.03517
Kabutz Leon 1.00000 0.00735 0.00735
Gotti Oliver 1.00000 0.00000 0.03431
Gotti Patrick 1.00000 0.05882 0.06066
Oliver Patrick 1.00000 0.03676 0.02022
Zhuo Oliver 1.00000 0.02574 0.03885
Zhuo Gotti 1.00000 0.05515 0.10184
Zhuo Patrick 1.00000 0.02941 0.04412
Kabutz Gotti 1.00000 0.07353 0.12586
Leon Gotti 1.00000 0.07353 0.12586
Polark Yu 0.50000 0.41176 0.41176
Polark Chang 1.00000 0.11029 0.11029
Chang Angel 1.00000 0.00735 0.00735
Polark Angel 1.00000 0.11029 0.11029
Weng Polark 1.00000 0.11029 0.11029
Weng Chang 1.00000 0.00735 0.00735
Weng Angel 1.00000 0.00735 0.00735
Christoph Yu 0.50000 0.13603 0.15870
Christoph Nardo 1.00000 0.04779 0.04412
Christoph Gotti 1.00000 0.02574 0.09620
Christoph Zhuo 1.00000 0.03309 0.05147
Nardo Gotti 1.00000 0.05515 0.05147
Nardo Zhuo 1.00000 0.02206 0.02941
Graffe Yu 0.50000 0.18015 0.12402
Graffe Hund 1.00000 0.06985 0.04804
Graffe Zhuo 1.00000 0.03676 0.08578
Zhuo Hund 1.00000 0.05515 0.07696



Note that Chapman (director) and Yu (manager, reporting to Chapman) both have the highest weighted closeness centrality. However, Yu’s weighted betweenness centrality is highest because he serves as more of a gatekeeper between his three groups (D4a, D4b, and D4c) and the rest of the department.