lans {simplifyNet} | R Documentation |
Local Adaptive Network Sparsification
Description
Remove all edges under certain probability of the fractional edge weight, alpha
.
Usage
lans(network, alpha, output, directed = FALSE)
Arguments
network |
Weighted adjacency matrix, weighted |
alpha |
The |
output |
If the output should be directed or undirected. Default is that the output is the same as the input based on adjacency matrix symmetry. If the default is overridden, set as either "undirected" or "directed". |
directed |
If |
Details
For more information on finding alpha values, see: https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0016431#s5
Value
Weighted adjacency matrix of sparsified network.
Author(s)
Andrew Kramer
Alexander Mercier
References
Foti, N. J., Hughes, J. M., & Rockmore, D. N. (2011). Nonparametric sparsification of complex multiscale networks. PloS one, 6(2), e16431.
Examples
#Generate random ER graph with uniformly random edge weights
g = igraph::erdos.renyi.game(100, 0.1)
igraph::E(g)$weight <- runif(length(igraph::E(g)))
#Sparsify g via LANS
S = lans(g, alpha = 0.3, output = "undirected", directed = FALSE)
#Convert sparsifier to edge list
S_List = simplifyNet::Mtrx_EList(S, directed = FALSE)
sg = simplifyNet::net.as(S_List, net.to="igraph", directed=FALSE)
igraph::ecount(sg)/igraph::ecount(g)#fraction of edges in the sparsifier