tdc: Temporal degree centrality

Description Usage Arguments Details Value Warning References See Also Examples

Description

tdc returns the temporal degree centrality for each node in a dynamic network (sequence of graph snapshots).

Usage

1
2
tdc(x, type = NULL, startsnapshot = 1, endsnapshot = length(x),
  directed = FALSE, normalize = TRUE, centrality_evolution = FALSE)

Arguments

x

A list of adjacency matrices or a list of adjacency lists.

type

Data format of x. Possible formats are "M" for a list of adjacency matrices (containing only 1s and 0s) and "L" for a list of adjacency lists (adjacency lists of the igraph package are supported). Default is NULL.

startsnapshot

Numeric. Entry of x to start the calculation of tdc. Default is 1.

endsnapshot

Numeric. Entry of x to end the calculation of tdc. Default is the last element of x.

directed

Logical. Set TRUE if the temporal network is a directed network. Default is FALSE.

normalize

Logical. Set TRUE if centrality values should be normalized with 1/((|V|-1)*m) where |V| is the number of nodes and m = endsnapshot - startsnapshot. Default is TRUE.

centrality_evolution

Logical. Set TRUE if an additional matrix should be returned containing the centrality values at each snapshot. Rows correspondent to nodes, columns correspondent to snapshots. Default is FALSE.

Details

tdc calculates the temporal degree centrality (see Kim and Anderson, 2012), which is defined as the average degree centrality over all snapshots.

Value

The (normalized) temporal degree centrality values of all nodes (TDC). If centrality_evolution is TRUE an additional matrix is returned (CentEvo), containing the temporal centrality value at each snapshot between startsnapshot and endsnapshot.

Warning

Using adjacency matrices as input exponentially increases the required memory. Use adjacency lists to save memory.

References

Kim, Hyoungshick and Anderson, Ross, 2012. Temporal node centrality in complex networks. Physical Review E, 85 (2).

See Also

tbc,tcc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Create a list of adjacency matrices, plot the corresponding graphs
# (using the igraph package) and calculating tdc

A1 <- matrix(c(0,1,0,0,0,0,
               1,0,1,0,0,0,
               0,1,0,0,0,0,
               0,0,0,0,0,0,
               0,0,0,0,0,0,
               0,0,0,0,0,0), ncol=6)

A2 <- matrix(c(0,0,0,0,0,0,
               0,0,1,0,0,0,
               0,1,0,1,1,0,
               0,0,1,0,0,0,
               0,0,1,0,0,0,
               0,0,0,0,0,0), ncol=6)

A3 <- matrix(c(0,0,0,0,0,0,
               0,0,0,0,0,0,
               0,0,0,0,0,0,
               0,0,0,0,0,0,
               0,0,0,0,0,0,
               0,0,0,0,0,0), ncol=6)

A4 <- matrix(c(0,1,0,0,0,0,
               1,0,0,1,0,0,
               0,0,0,0,0,0,
               0,1,0,0,0,0,
               0,0,0,0,0,0,
               0,0,0,0,0,0), ncol=6)

library(igraph)
par(mfrow=c(2,2))

Layout <-
 layout_in_circle(graph_from_adjacency_matrix(A1, mode = "undirected"))

plot(graph_from_adjacency_matrix(A1, "undirected"), layout=Layout)
plot(graph_from_adjacency_matrix(A2, "undirected"), layout=Layout)
plot(graph_from_adjacency_matrix(A3, "undirected"), layout=Layout)
plot(graph_from_adjacency_matrix(A4, "undirected"), layout=Layout)

As <- list(A1,A2,A3,A4)

tdc(As, "M", centrality_evolution=TRUE)

#' ### Create list of adjacency lists
Ls <- lapply(seq_along(As), function(i){
  sapply(1:6, function(j){which(As[[i]][j,]==1)})
})

tdc(Ls, "L", centrality_evolution=TRUE)

TNC documentation built on May 2, 2019, 4:02 p.m.

Related to tdc in TNC...