gns {simplifyNet}R Documentation

Global Network Sparsification

Description

Remove all edges under certain edge weight threshold.

Usage

gns(network, remove.prop, cutoff, directed = FALSE)

Arguments

network

Weighted adjacency matrix, weighted igraph network, or edge list formatted | n1 | n2 | weight | with colnames c("n1", "n2", "weight").

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 TRUE, specifies that the inputted network is directed. Default is FALSE.

Value

Edge list of sparsified network

Author(s)

Andrew Kramer

Alexander Mercier

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 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

[Package simplifyNet version 0.0.1 Index]