Sparsify.matrix.fixed.neighbours-methods: Sparsifying the graph by a fixed number of edges per node

Sparsify.matrix.fixed.neighbours-methodsR Documentation

Sparsifying the graph by a fixed number of edges per node

Description

Methods to sparsify a network matrix by fixing the number of edges for each node. It selects the first k neighbours for each node (by row) according to the weight of the edge By this function you select exactly k edges for each node (if there are at least k edges in the adjacency matrix). The resulting matrix is not symmetric.

Usage

Sparsify.matrix.fixed.neighbours(W, k=10)

Arguments

W

an object representing the graph to be normalized

k

the number of edges for each node (def.=10)

Value

a sparsified matrix (Warning: the matrix is not symmetric)

Methods

signature(W = "graph")

an object of the virtual class graph (hence including objects of class graphAM and graphNEL from the package graph)

signature(W = "matrix")

a matrix representing the adjacency matrix of the graph

Examples

library(bionetdata);
data(FIN.data);
W <- Laplacian.norm(as.matrix(FIN.data));
# sparsification with 10 neighbours per node 
W10 <- Sparsify.matrix.fixed.neighbours(W);
# sparsification with 20 neighbours per node 
W20 <- Sparsify.matrix.fixed.neighbours(W, k=20);

NetPreProc documentation built on Sept. 19, 2022, 5:06 p.m.