Visualization of an undirected social network of frequent associations between 62 dolphins in a community living off Doubtful Sound, New Zealand, as compiled by Lusseau et al. (2003).
REFERENCES :
D. Lusseau, K. Schneider, O. J. Boisseau, P. Haase, E. Slooten, and S. M. Dawson, The bottlenose dolphin community of Doubtful Sound features a large proportion of long-lasting associations, Behavioral Ecology and Sociobiology 54, 396-405 (2003).
https://networkdata.ics.uci.edu/data.php?id=6
VISUALIZATION :
What is the data that you chose? Why? : We selected the above dataset on the UCI repository as we were interested in the communities and interactions among dolphins.
Did you use a subset of the data? If so, what was it? : The full gml file was used. GML (Graph Modeling Language) is a text file format supporting network data with a very easy syntax.
library(igraph)
## Warning: package 'igraph' was built under R version 3.2.1
##
## Attaching package: 'igraph'
##
## The following objects are masked from 'package:stats':
##
## decompose, spectrum
##
## The following object is masked from 'package:base':
##
## union
g<-read.graph("dolphins.gml",format=c("gml"))
g
## IGRAPH U--- 62 159 --
## + attr: id (v/n), label (v/c)
## + edges:
## [1] 4-- 9 6--10 7--10 1--11 3--11 6--14 7--14 10--14 1--15 4--15
## [11] 1--16 15--17 2--18 7--18 10--18 14--18 16--19 2--20 8--20 9--21
## [21] 17--21 19--21 19--22 18--23 15--25 16--25 19--25 18--26 2--27 26--27
## [31] 2--28 8--28 18--28 26--28 27--28 2--29 9--29 21--29 11--30 19--30
## [41] 22--30 25--30 8--31 20--31 29--31 18--32 10--33 14--33 13--34 15--34
## [51] 17--34 22--34 15--35 34--35 30--36 2--37 21--37 24--37 9--38 15--38
## [61] 17--38 22--38 34--38 35--38 37--38 15--39 17--39 21--39 34--39 37--40
## [71] 1--41 8--41 15--41 16--41 34--41 37--41 38--41 2--42 10--42 14--42
## + ... omitted several edges
# Community Plot
wc <- cluster_walktrap(g)
modularity(wc)
## [1] 0.4888454
membership(wc)
## [1] 2 1 2 3 3 1 1 1 3 1 2 3 2 1 2 3 2 1 3 1 2 3 1 3 3 1 1 1 1 3 1 1 4 2 2
## [36] 3 3 2 2 1 2 1 2 2 2 3 2 2 1 2 2 3 2 2 1 3 1 1 2 3 4 2
g$name <- "Undirected social network of frequent associations between 62 dolphins"
tkplot(g, vertex.color=membership(wc),
layout = layout.fruchterman.reingold,
main = g$name,
vertex.label = V(g)$name,
vertex.size = 9,
vertex.color= V(g)$color,
vertex.frame.color= "white",
vertex.label.color = "black",
vertex.label.family = "sans",
edge.width=E(g)$weight,
edge.color="black"
)
## [1] 1
GRAPH PARAMETERS:
# Edge List
gl <- as_edgelist(g, names = TRUE)
gl
## [,1] [,2]
## [1,] 4 9
## [2,] 6 10
## [3,] 7 10
## [4,] 1 11
## [5,] 3 11
## [6,] 6 14
## [7,] 7 14
## [8,] 10 14
## [9,] 1 15
## [10,] 4 15
## [11,] 1 16
## [12,] 15 17
## [13,] 2 18
## [14,] 7 18
## [15,] 10 18
## [16,] 14 18
## [17,] 16 19
## [18,] 2 20
## [19,] 8 20
## [20,] 9 21
## [21,] 17 21
## [22,] 19 21
## [23,] 19 22
## [24,] 18 23
## [25,] 15 25
## [26,] 16 25
## [27,] 19 25
## [28,] 18 26
## [29,] 2 27
## [30,] 26 27
## [31,] 2 28
## [32,] 8 28
## [33,] 18 28
## [34,] 26 28
## [35,] 27 28
## [36,] 2 29
## [37,] 9 29
## [38,] 21 29
## [39,] 11 30
## [40,] 19 30
## [41,] 22 30
## [42,] 25 30
## [43,] 8 31
## [44,] 20 31
## [45,] 29 31
## [46,] 18 32
## [47,] 10 33
## [48,] 14 33
## [49,] 13 34
## [50,] 15 34
## [51,] 17 34
## [52,] 22 34
## [53,] 15 35
## [54,] 34 35
## [55,] 30 36
## [56,] 2 37
## [57,] 21 37
## [58,] 24 37
## [59,] 9 38
## [60,] 15 38
## [61,] 17 38
## [62,] 22 38
## [63,] 34 38
## [64,] 35 38
## [65,] 37 38
## [66,] 15 39
## [67,] 17 39
## [68,] 21 39
## [69,] 34 39
## [70,] 37 40
## [71,] 1 41
## [72,] 8 41
## [73,] 15 41
## [74,] 16 41
## [75,] 34 41
## [76,] 37 41
## [77,] 38 41
## [78,] 2 42
## [79,] 10 42
## [80,] 14 42
## [81,] 1 43
## [82,] 3 43
## [83,] 11 43
## [84,] 31 43
## [85,] 15 44
## [86,] 30 44
## [87,] 34 44
## [88,] 38 44
## [89,] 39 44
## [90,] 3 45
## [91,] 21 45
## [92,] 35 45
## [93,] 39 45
## [94,] 9 46
## [95,] 16 46
## [96,] 19 46
## [97,] 22 46
## [98,] 24 46
## [99,] 25 46
## [100,] 30 46
## [101,] 38 46
## [102,] 44 47
## [103,] 1 48
## [104,] 11 48
## [105,] 21 48
## [106,] 29 48
## [107,] 31 48
## [108,] 43 48
## [109,] 35 50
## [110,] 47 50
## [111,] 15 51
## [112,] 17 51
## [113,] 21 51
## [114,] 34 51
## [115,] 43 51
## [116,] 46 51
## [117,] 5 52
## [118,] 12 52
## [119,] 19 52
## [120,] 22 52
## [121,] 24 52
## [122,] 25 52
## [123,] 30 52
## [124,] 46 52
## [125,] 51 52
## [126,] 15 53
## [127,] 30 53
## [128,] 39 53
## [129,] 41 53
## [130,] 44 54
## [131,] 2 55
## [132,] 7 55
## [133,] 8 55
## [134,] 14 55
## [135,] 20 55
## [136,] 42 55
## [137,] 16 56
## [138,] 52 56
## [139,] 6 57
## [140,] 7 57
## [141,] 6 58
## [142,] 7 58
## [143,] 10 58
## [144,] 14 58
## [145,] 18 58
## [146,] 40 58
## [147,] 42 58
## [148,] 49 58
## [149,] 55 58
## [150,] 39 59
## [151,] 4 60
## [152,] 9 60
## [153,] 16 60
## [154,] 37 60
## [155,] 46 60
## [156,] 33 61
## [157,] 3 62
## [158,] 38 62
## [159,] 54 62
closeness
The closeness centrality of a vertex is defined by the inverse of the average length of the shortest paths to/from all the other vertices in the graph:
1/sum( d(v,i), i != v)
closeness(g)
## [1] 0.005681818 0.006097561 0.004629630 0.005050505 0.004081633
## [6] 0.003906250 0.004385965 0.005988024 0.005952381 0.004132231
## [11] 0.005128205 0.004081633 0.004405286 0.004444444 0.006172840
## [16] 0.005555556 0.005405405 0.005076142 0.005524862 0.005181347
## [21] 0.006410256 0.005464481 0.003891051 0.005464481 0.005128205
## [26] 0.004184100 0.004545455 0.005181347 0.005988024 0.005291005
## [31] 0.005291005 0.003891051 0.003546099 0.005988024 0.005181347
## [36] 0.004016064 0.006849315 0.006535948 0.005405405 0.005494505
## [41] 0.006622517 0.004878049 0.005405405 0.005524862 0.005102041
## [46] 0.005681818 0.004201681 0.005555556 0.003816794 0.004048583
## [51] 0.005747126 0.005405405 0.005617978 0.004255319 0.005319149
## [56] 0.004444444 0.003496503 0.004950495 0.004081633 0.005617978
## [61] 0.002923977 0.004950495
Betweeness
The vertex and edge betweenness are (roughly) defined by the number of geodesics (shortest paths) going through a vertex or an edge.
betweenness(g)
## [1] 34.921151 390.383717 16.603247 4.344048 0.000000 8.015949
## [7] 53.751742 216.376673 40.929300 38.236716 29.448398 0.000000
## [13] 0.000000 96.708781 113.408769 60.924764 6.047619 209.169298
## [19] 27.184466 24.365341 187.841704 23.242197 0.000000 77.194498
## [25] 13.510970 3.008730 7.983333 53.503455 122.165227 119.918587
## [31] 60.482343 0.000000 60.000000 104.614585 59.831410 0.000000
## [37] 454.274069 253.582713 82.994597 129.045705 261.963619 42.550429
## [43] 53.359052 114.980006 22.029185 74.426906 5.505495 42.458701
## [49] 0.000000 1.700000 61.142194 154.959376 35.198851 2.183333
## [55] 181.392614 1.605769 0.250000 154.094571 0.000000 37.208978
## [61] 0.000000 25.976818