Giter VIP home page Giter VIP logo

network-immunization's Introduction

Introduction

The repository contains source files for Node Immunization algorithms. Given a directed network and a set of seed nodes, the problem is to select k nodes which to block/immunize so that the expected influence spread in the network is minimized. Simulations performed under Independent Cascade model.

Supported algorithms:

  • Degree : degree heuristic
  • Dom : DAVA, dominator tree based algorithm
  • NetShape : Convex optimization of a hazard matrix
  • NetShield : Minimization of a shield value
  • Random : Random selection of blocked nodes

Requirements

Required libraries: NetworkX, SciPy, NumPy.

pip3 install networkx scipy numpy

The repository is provided by Pipfile.

Data

All algorithms require two files with a network and a seed set, in pickled NetworkX format for the network and csv file with node ids for seeds. Graphs should have 'graph_id' attribute.

For synthetic data, Generator class is used to generate random networks according to several growth models. Real-world networks are not included in the repository.

Usage

Graph Generation

python3 Generator.py graph_type [-p other params]

For example:

python3 Generator.py grid a.pkl b.csv -p n 10

Benchmarking

The script run_solver.py applies an algorithm to a graph with seeds, and runs simulations for the objective evaluations (number of saved nodes in the graph).

Minimum usage:

python3 run_solver.py path_to_graph path_to_seeds k algorithm_name

For other parameters run:

python3 run_solver.py -h

If using pipenv, then all commands should precede by pipenv run.

Notes

Walk8 Solver is not available as the code was provided by authors of "Scalable Approximation Algorithm for Network Immunization" and the algorithm is implemented in MATLAB.

network-immunization's People

Contributors

allogn avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.