Learn R Programming

keyplayer (version 1.0.1)

kpset: Selecting the Most Central Group of Players in a Network

Description

kpset implements a greedy search algorithm to find the most central players given the sepcified centraliy measure and the target group size.

Usage

kpset(adj.matrix, size, type, M = Inf, T = ncol(adj.matrix), method,
  binary = FALSE, cmode, iteration = 1000)

Arguments

adj.matrix
Matrix indicating the adjacency matrix of the network.
size
Integer indicating the target size of players.
type
type="betweenness" for betweenness centrality. type="closeness" for closeness centrality. type="degree"
M
Positive number indicating the maximum geodistance between two nodes, above witch the two nodes are considered disconnected. The default is Inf. The option is applicable to mreach.degree, mreach.closeness, and fragmentation centralities.
T
Integer indicating the maximum number of iterations of communication process. For diffusion centrality only. In the first iteration, the adjacency matrix is as the input. In the nth iteration, the adjacency matrix becomes the input adjacency matrix to
method
Indication of which grouping criterion should be used. "min" indicates the "minimum" criterion and is the default for betweenness, closeness, fragmentation, and M-reach centralities. "max" indicates the "maximum" criterion and
binary
If TRUE, the adjacency matrix is binarized. If FALSE, the edge values are considered. By default, binary=FALSE
cmode
String indicating the type of centrality being evaluated. The option is applicable to degree and M-reach centralities. "outdegree", "indegree", and "total" refer to indegree, outdegree, and (total) degree respecti
iteration
The upper boound of the number of search amount. See Details section for the definition.

Value

  • kpset returns the column indices of the players who form the most central set and its centrality score.

Details

The most central individuals together do not necessarily form the most central set in a netowrk as they may share overlapped connections. Hence, a greedy search algorithm is implemented here to identify the key set of players. The basic logic is as the following:
  1. Randomly select a set of nodesC. The remaining set of nodes is denoted asR.
  2. Update the selected setC.
    1. Replace nodeiinCwith nodejinR. Replaceibyjif thejth replacement improves the centrality ofCthe most. (loop 1)
    2. Repeat loop 1 for each node inC(loop 2)
    3. Stop if (a) the change inC's centrality score is smaller than a specified threshold or (b) the process reaches the specified number of iterations (i.e., the number of loop 2).
  3. Return the final candidate set and the centrality score.
See empirical examples in An and Liu (2015).

References

An, Weihua. (2015). "Multilevel Meta Network Analysis with Application to Studying Network Dynamics of Network Interventions." Social Networks 43: 48-56. An, Weihua and Yu-Hsin Liu (2015). "keyplayer: An R Package for Locating Key Players in Social Networks." Working Paper, Indiana Univeristy. Borgatti, Stephen P. (2006). "Identifying Sets of Key Players in a Network." Computational, Mathematical and Organizational Theory, 12(1):21-34. Butts, Carter T. (2014). sna: Tools for Social Network Analysis. R package version 2.3-2. http://CRAN.R-project.org/package=sna

Examples

Run this code
# Create a 5x5 weighted and directed adjacency matrix
W <- matrix(
  c(0,1,3,0,0,
    0,0,0,4,0,
    1,1,0,2,0,
    0,0,0,0,3,
    0,2,0,0,0),
    nrow=5, ncol=5, byrow = TRUE)

# Find the most central player set sized 2 in terms of the degree centrality
kpset(W,size=2,type="degree")

Run the code above in your browser using DataLab