gns {simplifyNet} | R Documentation |
Remove all edges under certain edge weight threshold.
gns(network, remove.prop, cutoff, directed = FALSE)
network |
Weighted adjacency matrix, weighted |
remove.prop |
The proportion of highest weighted edges to retain. A value between 0 and 1. |
cutoff |
Threshold value for edge weight thresholding. |
directed |
If |
Edge list of sparsified network
Andrew Kramer
Alexander Mercier
#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 GNS
S = gns(g, remove.prop = 0.5)
sg = simplifyNet::net.as(S, net.to="igraph", directed=FALSE)
igraph::ecount(sg)/igraph::ecount(g)#fraction of edges in the sparsifier