View source: R/ToivonenBestPath.R
bestpath | R Documentation |
Calculates network sparsifier from best path
bestpath(network, directed = FALSE, associative = TRUE)
network |
Weighted adjacency matrix, weighted |
directed |
If |
associative |
Designates if the network is associative where edge weight determines "similarity" or "strength" or dissociative where edge weight denotes "dissimilarity" or "distance". |
Edge list of sparsified network via best path.
Alexander Mercier
Andrew Kramer
Toivonen, H., Mahler, S., & Zhou, F. (2010, May). A framework for path-oriented network simplification. In International Symposium on Intelligent Data Analysis (pp. 220-231). Springer, Berlin, Heidelberg.
#Generate random ER graph with uniformly random edge weights g = igraph::erdos.renyi.game(50, 0.1) igraph::E(g)$weight <- runif(length(igraph::E(g))) #Sparsify g via bestpath S = simplifyNet::bestpath(g, directed = FALSE, associative = TRUE) #Show edge list conversion sg = simplifyNet::net.as(S, net.to="igraph", directed=FALSE) igraph::ecount(sg)/igraph::ecount(g)#fraction of edges in the sparsifier
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.