In this exercise, we will delve deeper into the characteristics of social networks by examining the density and components of a network using the Moreno dataset.
Network density is a measure that shows the proportion of the observed ties in a network compared to the maximum possible number of ties. It provides an understanding of how interconnected a network is.
In R, we can calculate the density of a network using the gden()
function from the network package:
gden(Moreno)
0.08712121
If you’re using the igraph package, you can use the graph.density()
or edge_density()
functions.
A component of a network is a subgroup in which all actors are connected, either directly or indirectly. Identifying components can help us understand the structure and connectivity within the network.
In R, we can find the components of a network using the components()
function from the network package:
components(Moreno)
[1] 2
The igraph package also provides a components()
function,
which gives additional information about each subgroup, including its size and its name.
$membership
SE PH PD LN MB AP SM CB TB2 RBW NW AL DB CWB BS AC
1 1 1 1 1 2 2 3 3 3 3 1 1 1 1 1
BW DZM KW VST TM CR AAE HRS LRS SL JJ TBC LE BCL SLL TNB
1 1 1 3 3 1 1 1 1 1 4 4 4 1 1 5
MGE JLG DGT DK WT DSW ME MWB BD LL BB LSM KM SP LCP ADE
5 5 5 3 3 3 3 1 1 1 1 1 1 6 6 6
KH ECS KT GB RBH JU JZ DSM BL CG CSH GGA ADL DL LBF GL
6 6 6 7 7 7 7 7 1 1 1 1 1 1 1 1
CS DSF ALL CW1 DZB PW ARL LZ MBM RW ECW JK ASS SS1 SMH TB1
1 1 1 1 1 1 1 1 1 3 3 3 3 3 3 3
DM LBW MD TR DSG LRG SS2 JLT LSF TSL LBC LLB DW
3 3 1 5 5 5 3 1 1 1 8 9 10
$csize
[1] 47 2 20 3 7 6 5 1 1 1
$no
[1] 10
To access only the number of components, write $no
after the components()
function.
Using the facebook dataset,
obtain the density of the igraph object and store this into density
.
Note that this time the Facebook object is different from the previous exercise.
To download the facebook dataset click: here1
Assume that: