Title: | Locating Key Players in Social Networks |
---|---|
Description: | Computes group centrality scores and identifies the most central group of players in a network. |
Authors: | Weihua An; Yu-Hsin Liu |
Maintainer: | Weihua An <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.0.4 |
Built: | 2024-11-03 03:19:16 UTC |
Source: | https://github.com/cran/keyplayer |
contract
combines selected nodes into one large pseudo-node and provides a reduced network.
contract(adj.matrix, nodes, method = c("min", "max", "union", "add"))
contract(adj.matrix, nodes, method = c("min", "max", "union", "add"))
adj.matrix |
Matrix indicating the adjacency matrix of the network. The inputted adjacency matrix for the diffusion centrality should be properly transfomred to the probability interpretation. |
nodes |
Integer indicating the column index of the chosen player in the adjacenncy matrix. |
method |
Indication of which grouping criterion should be used. |
Minimum Criterion: the edge value between a group and an outside node
is measured as the minimal value among all the (nonzero) edge values between
any node in the group and the outside node. Suggested if edge values are
interpreted as distances.
Example: suppose node A to C has distance 2 and B to C has distance 1,
then according to the minimum criterion, the distance between C and
the merged set AB is 1. Note that if B and C are not connected,
the algorithm takes the distance between A and C to describe
the distance between AB and C.
Maximun Criterion: the edge value between a group and an outside node
is measured as the maximal value among all the (nonzero) edge values between
any node in the group and the outside node. Suggested if edge values are
interpreted as non-cummulative strengths.
Example: we keep using the above example, but the figure now indicates
the strength of tie. According to the maximum criterion, the strength of tie
between AB and C is 2.
Addition Criterion: the edge value between a group and an outside node
is measured as the sum of all the edge values between any node in the group
and the outside node. Suggested if edge values are as cummulative strengths.
Example: according to the addition criterion, the strength of tie between
AB and C is 3
Union Criterion: the edge value between a group and an outside node is measured
as the probability that there is at least one path connecting the group with
the outside node. Suggested if edge values are as probability.
Example: suppose A has probability 0.2 to reach C and B has probability
0.5 to reach C, then C can be reached from merged AB with probability
1-(1-0.2)*(1-0.5)=0.6 according to the union criterion.
A new adjacency matrix after contracting the chosen nodes (named
set
).
Weihua An [email protected]; Yu-Hsin Liu [email protected]
An, Weihua and Yu-Hsin Liu (2016). "keyplayer: An R Package for Locating Key Players in Social Networks."
The R Journal, 8(1): 257-268.
# Create a 5x5 weighted and directed adjacency matrix, where edge values # represent the strength of tie 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) # If the strength is believed to be non-accumulative for a group of nodes, # it is proper to use the "maximum" criterion to contract node 2 and 3 contract(W,c(2,3),"max") # Transform the edge value to probability interpretaion P <- W *0.2 # Contract node 2 and 3 using the "union" criterion as it is proper for # probability matrix input contract(P,c(2,3),"union")
# Create a 5x5 weighted and directed adjacency matrix, where edge values # represent the strength of tie 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) # If the strength is believed to be non-accumulative for a group of nodes, # it is proper to use the "maximum" criterion to contract node 2 and 3 contract(W,c(2,3),"max") # Transform the edge value to probability interpretaion P <- W *0.2 # Contract node 2 and 3 using the "union" criterion as it is proper for # probability matrix input contract(P,c(2,3),"union")
diffusion
measures player's ability to disseminate information through all the
possible paths. For each path from i to j there is a reaching probability
, which is specified in the inputted adjacency matrix.
diffusion(adj.matrix, node, T = ncol(adj.matrix))
diffusion(adj.matrix, node, T = ncol(adj.matrix))
adj.matrix |
Matrix indicating the probability matrix. |
node |
Integer indicating the column index of the chosen player in the adjacenncy matrix. If not specified, scores for all nodes will be reported. |
T |
Integer indicating the maximum number of iterations of communication process. In the first iteration, the adjacency matrix is as the input. In the nth iteration, the adjacency matrix becomes the input adjacency matrix to the power of n. By default, T is the network size. |
The diffusion centrality measures the expected number of information receivers from a particular node (Banerjee et.al. 2013). The measure can approximate the degree, Katz-Bonacich, or eigenvector centrality when proper parameters are chosen. See Banerjee et.al. (2014) for details and proofs.
In its original parametrization (Banerjee et.al. 2013), P=q*g, where q is a measure of the information passing probability and g the adjacency matrix. For simplication and consistency with other centrality measures, the current packages asks users to input the probability matrix P directly. With information on q and the adjacency matrix, the probability matrix P can easily be calculated by their product.
A vector indicating the defusion centrality score(s) of the chosen player(s).
Weihua An [email protected]; Yu-Hsin Liu [email protected]
An, Weihua and Yu-Hsin Liu (2016). "keyplayer: An R Package for Locating Key Players in Social Networks."
The R Journal, 8(1): 257-268.
Banerjee, A., A. Chandrasekhar, E. Duflo, and M. Jackson (2013):
"Diffusion of Microfinance," Science, Vol. 341. p.363
Banerjee, A., A. Chandrasekhar, E. Duflo, and M. Jackson (2014):
"Gossip: Identifying Central Individuals in a Social Network,"
Working Paper.
# Create a 5x5 weighted and directed adjacency matrix, where edge values # represent the strength of tie 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) # Transform the edge value to probability interpretaion P <- W *0.2 # List the diffusion centrality score for every node diffusion(P, T = 2)
# Create a 5x5 weighted and directed adjacency matrix, where edge values # represent the strength of tie 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) # Transform the edge value to probability interpretaion P <- W *0.2 # List the diffusion centrality score for every node diffusion(P, T = 2)
fragment
measures the extent of fragmentation of a network after a
set of nodes is removed from the network. The more fragmented the residual network is, the more central a node is.
fragment( adj.matrix, nodes, M = Inf, binary = FALSE, large = TRUE, geodist.precomp = NULL )
fragment( adj.matrix, nodes, M = Inf, binary = FALSE, large = TRUE, geodist.precomp = NULL )
adj.matrix |
Matrix indicating the adjacency matrix of the network. |
nodes |
Integer indicating the column index of the chosen player
in the adjacenncy matrix. If there are multiple players,
use |
M |
Number indicating the maximum geodistance between two nodes,
above witch the two nodes are considered disconnected.
M hence defines the reachable set. The default is |
binary |
Logical scalar. If |
large |
Logical scalar, whether the computation method for large network is
implemented. If |
geodist.precomp |
Geodistance precomputed for the graph to be analyzed (optional). |
A natural way to apply the fragmentation centrality is in the context of counter-terrorism, as shown in Borgatti (2006). The measure uses geodistances to compute the fragmentation level of the residual network, and thus edge values should be properly adjusted to distance interpretation. The fragmentation centrality is not directional as edge values are counted aggregately at the network level.
Vector indicating fragment score(s) of the chosen player(s). Score is normalized to [0,1].
Weihua An [email protected]; Yu-Hsin Liu [email protected]
An, Weihua and Yu-Hsin Liu (2016). "keyplayer: An R Package for Locating Key Players in Social Networks."
The R Journal, 8(1): 257-268.
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. https://cran.r-project.org/package=sna
Csardi, G and Nepusz, T (2006). "The igraph software package for complex network research."
InterJournal, Complex Systems 1695. https://igraph.org/
geodist
;
shortest.paths
;
kpcent
;
kpset
# Create a 5x5 weighted and directed adjacency matrix, where edge values # represent the strength of tie 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) # Transform the edge value to distance interpretaion A <- W A[W!=0] <- 1/W[W!=0] # List the fragmentation centrality scores for every node fragment(A)
# Create a 5x5 weighted and directed adjacency matrix, where edge values # represent the strength of tie 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) # Transform the edge value to distance interpretaion A <- W A[W!=0] <- 1/W[W!=0] # List the fragmentation centrality scores for every node fragment(A)
The friendship network of 21 managers in a high-tech company
data("Friends")
data("Friends")
A network object for the friendship network of 21 managers in a high-tech company (Krackhardt, 1987). It is a directed network including 21 nodes and 60 edges. There are two node atrributes. "Dept" shows the department affiliations (1-4). "Level" shows the rank of the managers in the company (1-3).
@source D. Krackhardt. "Cognitive social structures." Social Networks, 9:109-134, 1987.
kpcent
reports the group-level centrality scores.
kpcent( adj.matrix, nodes, type, M = Inf, T = ncol(adj.matrix), method, binary = FALSE, cmode, large = TRUE, geodist.precomp = NULL )
kpcent( adj.matrix, nodes, type, M = Inf, T = ncol(adj.matrix), method, binary = FALSE, cmode, large = TRUE, geodist.precomp = NULL )
adj.matrix |
Matrix indicating the adjacency matrix of the network or the probability matrix in the case of calculating diffusion centrality. |
nodes |
Integer indicating the column index of the chosen player
in the adjacenncy matrix. If there are multiple players,
use |
type |
|
M |
Positive number indicating the maximum geodistance between two nodes,
above witch the two nodes are considered disconnected. The default is
|
T |
Integer indicating the maximum number of iterations of communication process. For diffusion centrality only. By default, T is the network size. |
method |
Indication of which grouping criterion should be used. |
binary |
If |
cmode |
String indicating the type of centrality being evaluated.
The option is applicable to degree and M-reach centralities.
|
large |
Logical scalar, whether the computation method for large network is
implemented. If |
geodist.precomp |
Geodistance precomputed for the graph to be analyzed (optional). |
The basic idea of measuring the group-level centrality is to treat a group of nodes as a large pseudo-node. We propose several methods to measure the tie status between this pseudo node and other nodes, responding to several common edge value interpretations (An and Liu, 2015).
Minimum Criterion: the edge value between a group and an outside node
is measured as the minimal value among all the (nonzero) edge values between
any node in the group and the outside node. Suggested if edge values are
interpreted as distances.
Example: suppose node A to C has distance 2 and B to C has distance 1,
then according to the minimum criterion, the distance between C and
the merged set AB is 1. Note that if B and C are not connected,
the algorithm takes the distance between A and C to describe
the distance between AB and C.
Maximun Criterion: the edge value between a group and an outside node
is measured as the maximal value among all the (nonzero) edge values between
any node in the group and the outside node. Suggested if edge values are
interpreted as non-cummulative strengths.
Example: we keep using the above example, but the figure now indicates
the strength of tie. According to the maximum criterion, the strength of tie
between AB and C is 2.
Addition Criterion: the edge value between a group and an outside node
is measured as the sum of all the edge values between any node in the group
and the outside node. Suggested if edge values are as cummulative strengths.
Example: according to the addition criterion, the strength of tie between
AB and C is 3
Union Criterion: the edge value between a group and an outside node is measured
as the probability that there is at least one path connecting the group with
the outside node. Suggested if edge values are as probability.
Example: suppose A has probability 0.2 to reach C and B has probability
0.5 to reach C, then C can be reached from merged AB with probability
1-(1-0.2)*(1-0.5)=0.6 according to the union criterion.
A vector indicating the centrality score of a group.
Weihua An [email protected]; Yu-Hsin Liu [email protected]
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 (2016). "keyplayer: An R Package for Locating Key Players in Social Networks."
The R Journal, 8(1): 257-268.
Banerjee, A., A. Chandrasekhar, E. Duflo, and M. Jackson (2013):
"Diffusion of Microfinance," Science, Vol. 341. p.363
Banerjee, A., A. Chandrasekhar, E. Duflo, and M. Jackson (2014):
"Gossip: Identifying Central Individuals in a Social Network,"
Working Paper.
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. https://cran.r-project.org/package=sna
Csardi, G and Nepusz, T (2006). "The igraph software package for complex network research."
InterJournal, Complex Systems 1695. https://igraph.org/
# Create a 5x5 weighted and directed adjacency matrix, # where edge values represent the strength of tie 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) # List the degree centrality for group of node 2 and 3 kpcent(W,c(2,3),type="degree") # Transform the edge value to distance interpretaion # Compute the fragmentation centrality for node 2 A <- W A[W!=0] <- 1/W[W!=0] kpcent(A,2,type="fragment") # Replicate the group-level degree centrality (normalized) when the weights # are given by the inverse distances and report the outgoing score only kpcent(A,c(2,3),type="mreach.closeness",binary=TRUE,M=1,cmode="outdegree") # Transform the edge value to probability interpretation # Compute the diffusion centrality with number of iteration 20 P <- 0.1*W kpcent(P,c(2,3),type="diffusion",T=20)
# Create a 5x5 weighted and directed adjacency matrix, # where edge values represent the strength of tie 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) # List the degree centrality for group of node 2 and 3 kpcent(W,c(2,3),type="degree") # Transform the edge value to distance interpretaion # Compute the fragmentation centrality for node 2 A <- W A[W!=0] <- 1/W[W!=0] kpcent(A,2,type="fragment") # Replicate the group-level degree centrality (normalized) when the weights # are given by the inverse distances and report the outgoing score only kpcent(A,c(2,3),type="mreach.closeness",binary=TRUE,M=1,cmode="outdegree") # Transform the edge value to probability interpretation # Compute the diffusion centrality with number of iteration 20 P <- 0.1*W kpcent(P,c(2,3),type="diffusion",T=20)
kpset
helps identify the most central group of players in a social network given a sepcified centraliy measure and a target group size.
kpset( adj.matrix, size, type = "degree", M = Inf, T = ncol(adj.matrix), method = "min", binary = FALSE, cmode = "total", large = TRUE, geodist.precomp = NULL, seed = "top", parallel = FALSE, cluster = 2, round = 10, iteration = ncol(adj.matrix) )
kpset( adj.matrix, size, type = "degree", M = Inf, T = ncol(adj.matrix), method = "min", binary = FALSE, cmode = "total", large = TRUE, geodist.precomp = NULL, seed = "top", parallel = FALSE, cluster = 2, round = 10, iteration = ncol(adj.matrix) )
adj.matrix |
Matrix indicating the adjacency matrix of the network or in the case of diffusion centrality a probability matrix. |
size |
Integer indicating the target size of players. |
type |
A string indicating the type of centrality measure to be used. Should be one of |
M |
Positive number indicating the maximum geodistance between two nodes,
above which the two nodes are considered disconnected. The default is |
T |
Integer indicating the maximum number of iterations in the communication process. By default, T is the network size. |
method |
Indication of which grouping criterion should be used. |
binary |
If |
cmode |
String indicating the type of centrality being evaluated.
The option is applicable to degree and M-reach centralities.
|
large |
Logical scalar. If |
geodist.precomp |
Geodistance precomputed for the network to be analyzed (optional). |
seed |
String indicating the seeding method or a vector of the seeds specified by user.
If |
parallel |
Logical scalar. IF |
cluster |
Integer indicating the number of CPU cores to be used for parallel computation. |
round |
Integer indicating the "length" of search, namely, the number of loops over the nodes in the candidate set. |
iteration |
Integer indicating the "width" of search in each round, namely, the number of loops over the nodes in the residual set. |
The most central group of players in a network is not necessarily the set of players who are the most central as individuals because there may be redundancy in their connections. Currenlty a greedy search algorithm is implemented in this package to identify the most central group of key players. The basic steps are shown as follows.
Select an initial candidate set C. The residual set is denoted as R.
Update the candidate set C.
Start with the first node in C. Try to swap it with nodes in R sequentially (loop 1). Make the swap if it improves the centrality score of the resulting C. The number of loop 1 is defined as the number of iterations (over the nodes in the residual set).
Repeat step 1 for each node in C sequentially (loop 2). The number of loop 2 is defined as the number of rounds (over the nodes in the candidate set).
Stop if (a) the change in C's centrality score is negligible (i.e. it is smaller than a pre-specified threshold determined by both the network size and edge values.) or (b) the process reaches a specified number of rounds.
Return the final candidate set and the centrality score.
It is recommended to run kpset
several times with different seeds so that the algorithm will not be trapped in a local optimum.
To facilitate the search in large networks, users may specify a reasonable number of iterations
or rounds and/or utilize parallel computation. During parallel computation, for each cluster and each iteration
the algorithm randomly picks a node from the candidate set and the residual set, respectively,
and swaps the two if it improves the centrality score of the candidate set. It repeats this process until exhausting the specified iterations and rounds
and then compare and combine the results from the clusters.
kpset
returns the column indices of the players who form
the most central set and its centrality score.
Weihua An [email protected]; Yu-Hsin Liu [email protected]
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 (2016). "keyplayer: An R Package for Locating Key Players in Social Networks."
The R Journal, 8(1): 257-268.
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. https://CRAN.R-project.org/package=sna
Csardi, G and Nepusz, T (2006). "The igraph software package for complex network research."
InterJournal, Complex Systems 1695. https://igraph.org
# 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") # Find two most central players in terms of indegree # via parallel computation using 5 cpu cores kpset(W,size=2,type="degree", cmode="indegree", parallel = TRUE, cluster = 2)
# 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") # Find two most central players in terms of indegree # via parallel computation using 5 cpu cores kpset(W,size=2,type="degree", cmode="indegree", parallel = TRUE, cluster = 2)
mreach.closeness
refines the mreach.degree
centrality by
using the (inverse) geodistance as weights.
The edge values should be properly interpreted as distances.
mreach.closeness( adj.matrix, node, M = Inf, binary = FALSE, cmode = "all", large = TRUE, geodist.precomp = NULL )
mreach.closeness( adj.matrix, node, M = Inf, binary = FALSE, cmode = "all", large = TRUE, geodist.precomp = NULL )
adj.matrix |
Matrix indicating the adjacency matrix of the network. |
node |
Integer indicating the column index of the chosen player in the adjacenncy matrix. If not specified, scores for all nodes will be reported. |
M |
Number indicating the maximum geodistance between two nodes,
above witch the two nodes are considered disconnected.
M hence defines the reachable set. The default is |
binary |
Logical scalar. If |
cmode |
String indicating the type of centrality being evaluated.
|
large |
Logical scalar, whether the computation method for large network is
implemented. If |
geodist.precomp |
Geodistance precomputed for the graph to be analyzed (optional). |
mreach.closeness
refines the mreach.degree
centrality
by using the (inverse) geodistance as weights, just as closeness
centrality refines degree
centrality.
It captures the degree centrality when M is properly set (e.g. M=1 in a binarized network).
It captures the Gil-Schmidt power index (Gil and Schmidt, 1996)
and the cohesion centrality (Borgatti, 2006) when M is sufficiently large
(unconstrained). The normalization factor takes care of non-binary
edge values. Also note that the geodistance matrix does
not necessarily to be symmetric.
A vector indicating the outdegree, indegree, or total-degree cohesion score of the chosen player; or a data frame containing all the above information. Note that the outdegree and indegree scores are normalized to [0,1]. This means that the total-degree score is between [0,2].
Weihua An [email protected]; Yu-Hsin Liu [email protected]
An, Weihua and Yu-Hsin Liu (2016). "keyplayer: An R Package for Locating Key Players in Social Networks."
The R Journal, 8(1): 257-268.
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. https://cran.r-project.org/package=sna
Csardi, G and Nepusz, T (2006). "The igraph software package for complex network research."
InterJournal, Complex Systems 1695. https://igraph.org/
Gil, J and Schmidt, S (1996). "The Origin of the Mexican Network of Power."
Proceedings of the International Social Network Conference, Charleston, SC, 22-25.
geodist
;
shortest.paths
;
mreach.degree
;
kpcent
;
kpset
# Create a 5x5 weighted and directed adjacency matrix, where edge values # represent the strength of tie 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) # Transform the edge value to distance interpretaion A <- W A[W!=0] <- 1/W[W!=0] # List all types of 2-reach closeness scores for every node mreach.closeness(A,M=2,cmode="all",large=FALSE)
# Create a 5x5 weighted and directed adjacency matrix, where edge values # represent the strength of tie 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) # Transform the edge value to distance interpretaion A <- W A[W!=0] <- 1/W[W!=0] # List all types of 2-reach closeness scores for every node mreach.closeness(A,M=2,cmode="all",large=FALSE)
mreach.degree
computes the size of reachable nodes from a particular node within M steps.
M-reach degree centrality generalizes the degree
centrality
by delimiting specific neighborhoods.
mreach.degree( adj.matrix, node, M = Inf, binary = TRUE, cmode = "all", large = TRUE, geodist.precomp = NULL )
mreach.degree( adj.matrix, node, M = Inf, binary = TRUE, cmode = "all", large = TRUE, geodist.precomp = NULL )
adj.matrix |
Matrix indicating the adjacency matrix of the network. |
node |
Integer indicating the column index of the chosen player in the adjacenncy matrix. If not specified, scores for all nodes will be reported. |
M |
Number indicating the maximum geodistance between two nodes,
above which the two nodes are considered disconnected.
M hence defines the reachable set. The default is |
binary |
Logical scalar. If |
cmode |
String indicating the type of centrality being evaluated.
|
large |
Logical scalar, whether the computation method for large network is
implemented. If |
geodist.precomp |
Geodistance precomputed for the graph to be analyzed (optional). |
The interprtation of the measure in binary and weighted adjacency matrix are slightly different. In binary networks, the reachable set of nodes is defined by nodes that are reachable within M steps. In weighted networks, the reachable set is defined by nodes that are reachable within geodistance M.
A vector indicating the outdegree, indegree, or total-degree mreach.degree score of the chosen node; or a data frame containing all the above information.
Weihua An [email protected]; Yu-Hsin Liu [email protected]
An, Weihua and Yu-Hsin Liu (2016). "keyplayer: An R Package for Locating Key Players in Social Networks."
The R Journal, 8(1): 257-268.
Butts, Carter T. (2014). sna: Tools for Social Network Analysis. R package
version 2.3-2. https://cran.r-project.org/package=sna
Csardi, G and Nepusz, T (2006). "The igraph software package for complex network research."
InterJournal, Complex Systems 1695. https://igraph.org/
geodist
;
shortest.paths
;
mreach.closeness
;
kpcent
;
kpset
# Create a 5x5 weighted and directed adjacency matrix, # where edge values represent the strength of tie 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) # List the 2-reach degree scores for every node where W is binarized mreach.degree(W,M=2,cmode="all",large=FALSE)
# Create a 5x5 weighted and directed adjacency matrix, # where edge values represent the strength of tie 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) # List the 2-reach degree scores for every node where W is binarized mreach.degree(W,M=2,cmode="all",large=FALSE)