High-Performance Features of the OPTGRAPH Procedure


Example: Centrality by Community for a Simple Undirected Graph

In Example: Community Detection on a Simple Undirected Graph, the COMMUNITY statement in PROC OPTGRAPH is used to detect communities in a simple undirected graph. The OUT_INTRA_COMM_LINKS= option in that example stores the resulting community partition in a table called gplib.CommIntraLinksOut. This table is also shown in FigureĀ 1.7 on .

Because this data set is stored on the appliance, it is already in the appropriate form to be used as input for running centrality by cluster. You can calculate the centrality metrics on the appliance, in parallel, by using this data set as input, as in the following call to PROC OPTGRAPH:

proc datasets nolist lib=gplib;
   delete NodeSetCentrality;
run;

proc optgraph
    data_links      = gplib.CommIntraLinksOut
    out_nodes       = gplib.NodeSetCentrality;
    performance
        host        = "grid001.example.com"
        install     = "/opt/TKGrid";
    centrality
        by_cluster
        degree      = out
        influence   = unweight
        close       = unweight
        between     = unweight
        eigen       = unweight;
run;

If you use the library gplib along with the OUT_NODES= option, the results of centrality computations are also stored in distributed form on the appliance in gplib.NodeSetCentrality. For the sake of display, a local version of the data is created and sorted as follows:

data NodeSetCentrality;
   set gplib.NodeSetCentrality;
run;
proc sort data=NodeSetCentrality;
   by cluster descending centr_eigen_unwt ;
run;

The results are shown in FigureĀ 1.8.

Figure 1.8: Centrality for All Induced Communities

node cluster centr_degree_out centr_eigen_unwt centr_close_unwt centr_between_unwt centr_influence1_unwt centr_influence2_unwt
C 0 4 1.00000 1.00000 0.58333 0.80000 1.60000
A 0 3 0.89897 0.80000 0.08333 0.60000 1.60000
B 0 2 0.70711 0.66667 0.00000 0.40000 1.40000
D 0 2 0.70711 0.66667 0.00000 0.40000 1.40000
E 0 1 0.37236 0.57143 0.00000 0.20000 0.80000
G 1 3 1.00000 1.00000 0.16667 0.75000 1.75000
F 1 3 1.00000 1.00000 0.16667 0.75000 1.75000
H 1 2 0.78078 0.75000 0.00000 0.50000 1.50000
I 1 2 0.78078 0.75000 0.00000 0.50000 1.50000
L 2 2 1.00000 1.00000 0.00000 0.66667 1.33333
J 2 2 1.00000 1.00000 0.00000 0.66667 1.33333
K 2 2 1.00000 1.00000 0.00000 0.66667 1.33333



For information about other options in the CENTRALITY statement, see the section "Centrality" in SAS OPTGRAPH Procedure: Graph Algorithms and Network Analysis.