Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/RelationStrengthSimilarity.R
For a single pair of nodes, implement the RSS algorithm of Chen et al. (2012).
1 2 3 | RelationStrengthSimilarity(xadj, v1, v2, radius = 3,
directed = TRUE,
method = c("Rcpp", "BetterR", "NaiveR"))
|
xadj |
numeric matrix, then description of
|
v1 |
numeric Object type, then description of
|
v2 |
numeric Object type, then description of
|
radius |
numeric, length of longest path examined
from |
directed |
logical, if TRUE returns a symmetric RSS matrix. |
method |
character, choose the method of calculation. |
If v1
and v2
are specified, this returns
the RSS from v1
to v2
. If not, it
calculates the RSS scores for all dyads in the network.
numeric, Relation Strength Similarity score(s).
Stephen R. Haptonstahl srh@haptonstahl.org
"Discovering Missing Links in Networks Using Similarity Measures", Hung-Hsuan Chen, Liang Gou, Xiaolong (Luke) Zhang, C. Lee Giles. 2012.
https://github.com/shaptonstahl/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | g1 <- graph.atlas(128)
## Not run: plot(g1)
M1 <- as.matrix(get.adjacency(g1))
M1
RelationStrengthSimilarity(xadj=M1, v1=5, v2=6, radius=1)
RelationStrengthSimilarity(xadj=M1, v1=5, v2=6, radius=2)
RelationStrengthSimilarity(xadj=M1, v1=5, v2=6, radius=3)
RelationStrengthSimilarity(xadj=M1, v1=5, v2=6, radius=4)
RelationStrengthSimilarity(xadj=M1, radius=2)
TestUndirectedNetwork <- function(n) {
M <- matrix(runif(n*n), nrow=n)
M <- (M + t(M)) / 2
diag(M) <- 0
return(M)
}
M2 <- TestUndirectedNetwork(75)
system.time(RelationStrengthSimilarity(xadj=M2, directed=FALSE, method="BetterR")) # all R
system.time(RelationStrengthSimilarity(xadj=M2, directed=FALSE)) # Rcpp
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.