Code for "Generic network sparsification via degree- and subgraph-based edge sampling" published in Information Sciences