Title: | Creates Vertex Similarity Matrix for an Undirected Graph |
---|---|
Description: | Creates Vertex Similarity matrix of an undirected graph based on the method stated by E. A. Leicht, Petter Holme, AND M. E. J. Newman in their paper <DOI:10.1103/PhysRevE.73.026120>. |
Authors: | Rishabh Singh |
Maintainer: | Rishabh Singh<[email protected]> |
License: | GPL-2 |
Version: | 0.1 |
Built: | 2024-10-29 06:19:07 UTC |
Source: | CRAN |
Returns Vertex Similarity matrix of undirected grahp based on the method stated by E. A. Leicht, Petter Holme, AND M. E. J. Newman <DOI:10.1103/PhysRevE.73.026120>
VertexSimilarity(m,alpha=0.97)
VertexSimilarity(m,alpha=0.97)
m |
Adjacency matrix of the graph |
alpha |
It tells the contribution of long paths relative to short ones.For, 0 < alpha < 1, similarity measure considers vertices to be more similar if they have a greater than expected number of short paths between them, than if they have a greater than expected number of long ones. |
This method is based on the idea that a pair of vertices i,j are similar to each other if any pair u,v of their neighbours is similar. Using this method we can even find similarity values for the vertices that are not directly connected.
m <- matrix(c(1,0,0,0,0,1,1,1,1),ncol=3,nrow=3,byrow=TRUE) SimilarityMatrix <- VertexSimilarity(m,alpha=0.85)
m <- matrix(c(1,0,0,0,0,1,1,1,1),ncol=3,nrow=3,byrow=TRUE) SimilarityMatrix <- VertexSimilarity(m,alpha=0.85)