DOCUMENTATION
  • Software
    • Software
    • SAS Viya
    • Industries
    • Solutions
    • Products
  • Learn
    • Learn
    • Training
    • Certification
    • Academics
    • Books
    • Video Tutorials
  • Support
    • Support
    • Communities
    • Documentation
    • Developers
    • Support & Services
    • User Groups
  • About Us
    • About Us
    • Why SAS?
    • Company
    • Careers
    • Newsroom
    • Events
    • Contact Us
  • Explore
    • Explore
    • Try & Buy
    • Why SAS?
    • Customer Stories
    • Partners
    • Consulting
  • Software
  • SAS Viya
  • Industries
  • Solutions
  • Products
  • Learn
  • Training
  • Certification
  • Academics
  • Books
  • Video Tutorials
  • Support
  • Communities
  • Documentation
  • Developers
  • Support & Services
  • User Groups
  • About Us
  • Why SAS?
  • Company
  • Careers
  • Newsroom
  • Events
  • Contact Us
  • Explore
  • Try & Buy
  • Why SAS?
  • Customer Stories
  • Partners
  • Consulting
  • Contact Us
Sign In

Create Profile

My SAS

Get access to My SAS, trials, communities and more.

SAS Sites

sas.com
Support
Blogs
Communities
Developer
Curiosity
Videos

Documentation

Learn
Brand
PartnerNet
Merchandise
SAS® Help Center
SAS® Viya® プラットフォームプログラミングドキュメント
2026.10
|PDF 
フィードバック
 
  • SAS プログラミングドキュメントへようこそ
  • 新機能
  • SAS Viya プラットフォームプログラミングの学習
  • 構文クイックリンク
  • Python プログラミング
  • 高度な分析
    • 機械学習
      • 機械学習入門ガイド
      • Computer Vision Procedures
      • Computer Vision Programming Guide
      • 深層学習プログラミングガイド
      • Deep Learning Model Zoo Procedures
      • Deep Learning Model Zoo Programming Guide
      • 機械学習プロシジャ
      • Machine Learning Programming Guide
      • NETWORK Procedure
        • Introduction
        • NETWORK Procedure
          • Overview
          • Getting Started
          • Syntax
          • Details
          • Examples
            • Articulation Points in a Terrorist Network
            • Influence Centrality for Project Groups in a Research Department
            • Betweenness and Closeness Centrality for Computer Network Topology
            • Betweenness and Closeness Centrality for Project Groups in a Research Department
            • Eigenvector Centrality for Word Sense Disambiguation
            • Community Detection on Zachary’s Karate Club Data
            • Recursive Community Detection on Zachary’s Karate Club Data
            • Centrality Metrics for an Undirected Graph by Community
            • Cycle Enumeration for Kidney Donor Exchange
            • Transitive Closure for Identification of Circular Dependencies in a Bug Tracking System
            • Reach Networks for Computing the Market Coverage of a Terrorist Network
            • Connected Components for US Patent Citations
            • Shortest Paths of the New York Road Network
            • Shortest Path in a Road Network by Date and Time
            • Pattern Matching in a Social Network
            • Detection of Value-Added Tax Carousel Fraud
            • Node Similarity for Link Prediction
            • A Node Similarity Recipe Recommendation Engine
            • Node Embeddings for Zachary’s Karate Club Data
            • Node Embeddings for European Roads Data
            • Learning Word Embeddings from Synonym Pairs
            • Using Projection to Recommend Recipe Ingredient Pairings
          • References
      • Real-Time Entity and Network Generation Procedures
      • 強化学習プログラミングガイド
    • 計量経済学
    • SAS Enterprise Miner: High-Performance Procedures
    • 予測
    • IML (Interactive Matrix Language)
    • 最適化とシミュレーション
    • 品質管理
    • 統計
    • SAS Visual Analytics Programming Guide
    • テキスト分析
  • データアクセス
  • Cloud Analytic Services
  • SAS 言語リファレンス
  • Migrating to UTF-8
  • 例のデータセット
  • SAS コードのデバッグ
  • アウトプットとグラフィック
  • In-Database 処理
  • セキュリティと管理
  • SAS Server
  • Using the batch Plug-In for the SAS Viya CLI
  • Accessibility on the SAS Viya Platform
  • SAS Data Quality
  • SAS Job Execution Web Application ドキュメントリンク
  • SAS Job Execution Web Application
  • SAS Data and AI Studio
  • SAS Visual Analytics
  • SAS Viya プラットフォーム: 管理
  • SAS Viya プラットフォーム 運用
  • その他のリソース
NETWORK Procedure
 

NETWORK Procedure

Overview
Getting Started
Syntax
Details
Examples
References

Example 2.8 Centrality Metrics for an Undirected Graph by Community

When you are trying to understand the roles of certain entities in a social network, a typical workflow is to first divide the network into communities and then calculate centrality metrics on the induced subgraphs defined by those communities. You can process these induced subgraphs of the original input graph with only one call to PROC NETWORK by using the BY statement. This section presents an example of how to use the COMMUNITY statement, followed by the CENTRALITY statement in conjunction with the BY statement.

Consider the graph depicted in Figure 230.

Figure 230: Undirected Graph

Undirected Graph


The following statements create the data table mylib.LinkSetIn:

data mylib.LinkSetIn;
   input from $ to $ @@;
   datalines;
A B  A C  A D  B C  C D
C E  D F  F G  F H  F I
G H  G I  I J  J K  J L
K L
;

First, call the community detection method as follows:

proc network
   links     = mylib.LinkSetIn
   outNodes  = mylib.OutNodesComms
   outLinks  = mylib.OutLinksComms;
   community;
run;

The resulting output is a partition of the links and nodes of the original graph into communities.

The data table that contains the assignment of nodes to communities, mylib.OutNodesComms, is shown in Output 2.8.1.

Output 2.8.1: Nodes for the Communities of an Undirected Graph

nodecommunity_1
A1
B1
C1
D1
E1
F2
G2
H2
I2
J3
K3
L3


The data table that contains the assignment of links to communities, mylib.OutLinksComms, is shown in Output 2.8.2.

Output 2.8.2: Links for the Communities of an Undirected Graph

fromtocommunity_1
DF.
IJ.
AB1
AC1
AD1
BC1
CD1
CE1
FG2
FH2
FI2
GH2
GI2
JK3
JL3
KL3


The graph seems to have three distinct parts, which are connected by just a few links. The induced subgraphs on these communities are shown in blue in Figure 231 through Figure 233.

Figure 231: Subgraph upper C Superscript 1 Baseline equals StartSet upper A comma upper B comma upper C comma upper D comma upper E EndSet

Subgraph C1 = {A,B,C,D,E}


Figure 232: Subgraph upper C squared equals StartSet upper F comma upper G comma upper H comma upper I EndSet

Subgraph C2 = {F,G,H,I}


Figure 233: Subgraph upper C cubed equals StartSet upper J comma upper K comma upper L EndSet

Subgraph C3 = {J,K,L}


Now, using one call to PROC NETWORK, you can calculate the centrality metrics for all three induced subgraphs by using the BY statement and the links partition defined by the community detection algorithm. In addition, because these subgraphs are completely independent, the processing is done in parallel across machines and threads (depending on your server configuration).

proc network
   links        = mylib.OutLinksComms(where=(community_1 ne .))
   outNodes     = mylib.NodeSetOut;
   centrality
      degree    = unweight
      influence = unweight
      close     = unweight
      between   = unweight
      eigen     = unweight;
   displayout
      ProblemSummary  = ProblemSummary
      SolutionSummary = SolutionSummary;
   by community_1;
run;
%put &_NETWORK_;

Assuming that your grid has a total of at least three cores, all three subgraphs are processed simultaneously with one call to PROC NETWORK. The progress of the procedure is shown in Output 2.8.3.

Output 2.8.3: PROC NETWORK Log: Centrality by Cluster for an Undirected Graph

NOTE: ------------------------------------------------------------------------------------------
NOTE: Running NETWORK.                                                                          
NOTE: ------------------------------------------------------------------------------------------
NOTE: The number of nodes in the input graph is 5.                                              
NOTE: The number of links in the input graph is 6.                                              
NOTE: Processing centrality metrics.                                                            
NOTE: Processing centrality metrics used 0.00 (cpu: 0.00) seconds.                              
NOTE: The above message was for the following BY group:                                         
      community_1=1                                                                             
NOTE: The number of nodes in the input graph is 4.                                              
NOTE: The number of links in the input graph is 5.                                              
NOTE: Processing centrality metrics.                                                            
NOTE: Processing centrality metrics used 0.00 (cpu: 0.00) seconds.                              
NOTE: The above message was for the following BY group:                                         
      community_1=2                                                                             
NOTE: The number of nodes in the input graph is 3.                                              
NOTE: The number of links in the input graph is 3.                                              
NOTE: Processing centrality metrics.                                                            
NOTE: Processing centrality metrics used 0.00 (cpu: 0.00) seconds.                              
NOTE: The above message was for the following BY group:                                         
      community_1=3                                                                             
NOTE: The Cloud Analytic Services server processed the request in 1.625014 seconds.             
NOTE: The data set MYLIB.NODESETOUT has 12 observations and 8 variables.                        
STATUS=OK  PROBLEM_TYPE=CENTRALITY  CPU_TIME=1.64  REAL_TIME=1.63                               


Notice that links that connect different partitions have been removed by using a WHERE clause on the LINKS= option in the PROC NETWORK statement.

The output table mylib.ProblemSummary contains a summary of each induced subgraph that is processed by PROC NETWORK.

Output 2.8.4: Problem Summary by Community

community_1numNodesnumLinksgraphDirection
156Undirected
245Undirected
333Undirected


The output table mylib.SolutionSummary contains a solution summary for the processing on each of the induced subgraphs.

Output 2.8.5: Solution Summary by Community

community_1problemTypestatuscpuTimerealTime
1CentralityOK0.000.00
2CentralityOK0.000.00
3CentralityOK0.000.00


The centrality results (by community) are shown in Output 2.8.6.

Output 2.8.6: Centrality for All Induced Subgraphs

community_1=1

nodecentr_degree_outcentr_eigen_unwtcentr_close_unwtcentr_between_unwtcentr_influence1_unwtcentr_influence2_unwt
A30.898970.800000.083330.61.6
B20.707110.666670.000000.41.4
C41.000001.000000.583330.81.6
D20.707110.666670.000000.41.4
E10.372360.571430.000000.20.8

community_1=2

nodecentr_degree_outcentr_eigen_unwtcentr_close_unwtcentr_between_unwtcentr_influence1_unwtcentr_influence2_unwt
F31.000001.000.166670.751.75
G31.000001.000.166670.751.75
H20.780780.750.000000.501.50
I20.780780.750.000000.501.50

community_1=3

nodecentr_degree_outcentr_eigen_unwtcentr_close_unwtcentr_between_unwtcentr_influence1_unwtcentr_influence2_unwt
J21100.666671.33333
K21100.666671.33333
L21100.666671.33333


Last updated: October 12, 2026
プライバシーについて 使用条件 
Copyright © SAS Institute Inc. All Rights Reserved
ドキュメントが翻訳されている場合は、アプリケーションバーの言語セレクターにその言語名が表示されます。以前のバージョンのドキュメントが翻訳されている場合もあります。バージョンの変更には、バージョンセレクターを使用します。