NETWORK Procedure
Example 2.3 Betweenness and Closeness Centrality for Computer Network Topology
Consider a small network of 10 computers spread out across an office. Let a node represent a computer, and let a link represent a direct connection between the machines. For this example, consider the links as Ethernet connections that enable data to transfer between computers. If two computers are not connected directly, then the information must flow through other connected machines. Consider a topology as shown in Figure 221. This is an example of the well-known kite network, which was popularized by Krackhardt (1990) for better understanding of social networks in the workplace.
Figure 221: Office Computer Network

Define the links data table as follows:
data mylib.LinkSetInCompNet;
input from $ to $ @@;
datalines;
A B A C A D B C B D
B E C D C F C H D E
D F D G E F E G F G
F H H I I J
;
To better understand the topology of the computer network, calculate the degree, closeness, and betweenness centrality. It is also interesting to look for articulation points in the computer network to identify places of vulnerability.
proc network
links = mylib.LinkSetInCompNet
outLinks = mylib.LinkSetOut
outNodes = mylib.NodeSetOutCentr;
centrality
degree = unweight
close = unweight
between = unweight;
run;
proc network
links = mylib.LinkSetInCompNet
outNodes = mylib.NodeSetOutBiCC;
biconnectedComponents;
run;
data mylib.NodeSetOut;
merge mylib.NodeSetOutCentr mylib.NodeSetOutBiCC;
by node;
run;
%put &_NETWORK_;
Output 2.3.1 shows the resulting nodes data table mylib.NodeSetOut sorted by closeness.
Output 2.3.1: Node Closeness and Betweenness Centrality, Sorted by Closeness
| node | centr_degree_out | centr_close_unwt | centr_between_unwt | artpoint |
|---|---|---|---|---|
| C | 5 | 0.64286 | 0.23148 | 0 |
| F | 5 | 0.64286 | 0.23148 | 0 |
| D | 6 | 0.60000 | 0.10185 | 0 |
| H | 3 | 0.60000 | 0.38889 | 1 |
| B | 4 | 0.52941 | 0.02315 | 0 |
| E | 4 | 0.52941 | 0.02315 | 0 |
| A | 3 | 0.50000 | 0.00000 | 0 |
| G | 3 | 0.50000 | 0.00000 | 0 |
| I | 2 | 0.42857 | 0.22222 | 1 |
| J | 1 | 0.31034 | 0.00000 | 0 |
Output 2.3.2 shows the resulting nodes data table (mylib.NodeSetOut) sorted by node betweenness.
Output 2.3.2: Node Closeness and Betweenness Centrality, Sorted by Betweenness
| node | centr_degree_out | centr_close_unwt | centr_between_unwt | artpoint |
|---|---|---|---|---|
| H | 3 | 0.60000 | 0.38889 | 1 |
| F | 5 | 0.64286 | 0.23148 | 0 |
| C | 5 | 0.64286 | 0.23148 | 0 |
| I | 2 | 0.42857 | 0.22222 | 1 |
| D | 6 | 0.60000 | 0.10185 | 0 |
| B | 4 | 0.52941 | 0.02315 | 0 |
| E | 4 | 0.52941 | 0.02315 | 0 |
| A | 3 | 0.50000 | 0.00000 | 0 |
| G | 3 | 0.50000 | 0.00000 | 0 |
| J | 1 | 0.31034 | 0.00000 | 0 |
Output 2.3.3 shows the resulting links data table (mylib.LinkSetOut) sorted by link betweenness.
Output 2.3.3: Link Betweenness Centrality, Sorted by Betweenness
| from | to | centr_between_unwt |
|---|---|---|
| H | I | 0.35556 |
| C | H | 0.23333 |
| F | H | 0.23333 |
| I | J | 0.20000 |
| B | C | 0.10370 |
| E | F | 0.10370 |
| A | C | 0.10000 |
| F | G | 0.10000 |
| C | D | 0.07407 |
| D | F | 0.07407 |
| A | D | 0.06667 |
| D | G | 0.06667 |
| B | E | 0.05926 |
| C | F | 0.05926 |
| B | D | 0.04074 |
| D | E | 0.04074 |
| A | B | 0.03333 |
| E | G | 0.03333 |
The computers that have the highest closeness centrality are C and F, because they have the average shortest paths to all the other nodes. These computers are key to the efficient distribution of information across the network. Assuming that the entire office has some centralized data that should be shared with all computers, machines C and F would be the best candidates for storing the data on their local hard drives. The computer that has the highest betweenness centrality is H. Although machine H has only three connections, it is one of the most important machines in the office because it serves as the only way to reach computers I and J from the other machines in the office. Notice also that machine H is an articulation point, because removing it would disconnect the office network. In this setting, computers with high betweenness should be carefully maintained and secured with UPS (uninterruptible power supply) systems to ensure that they are always online.