kpset implements a greedy search algorithm to find the most
central players given the sepcified centraliy measure and the target group size.kpset(adj.matrix, size, type, M = Inf, T = ncol(adj.matrix), method,
binary = FALSE, cmode, iteration = 1000)type="betweenness" for betweenness centrality.
type="closeness" for closeness centrality.
type="degree" Inf. The option is applicable to mreach.degree, mreach.closeness,
and fragmentation centralities."min" indicates the "minimum" criterion and is the default for
betweenness, closeness, fragmentation, and M-reach centralities.
"max" indicates the "maximum" criterion andTRUE, the adjacency matrix is binarized.
If FALSE, the edge values are considered. By default, binary=FALSE"outdegree", "indegree", and "total" refer to
indegree, outdegree, and (total) degree respectikpset returns the column indices of the players who form
the most central set and its centrality score.# 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