library(bionetdata);
data(FIN.data);
W <- Laplacian.norm(as.matrix(FIN.data));
# sparsification by maintaining at least one neighbour per node
W1 <- Sparsify.matrix(W);
# sparsification by maintaining at least 20 neighbours per node (if any)
W20 <- Sparsify.matrix(W, k=20);
Run the code above in your browser using DataLab