Giter Club home page Giter Club logo

relnet's Introduction

RelNet

RelNet is a counting-based network reliability framework using state-of-the-art approximate model counters like ApproxMC.

Requirements

  • Python 3
  • ApproxMC (for model counting)

Install

First download the repository:

$ git clone https://github.com/paredesroger/relnet
$ cd relnet

Install (optional) the package to make sure you meet Python dependencies:

$ python setup.py install

Background

In the K-terminal network reliability problem you are given a graph G=(V,K,E) and you are asked to compute the probability that the terminal nodes in K, a subset of V, will remain connected given that each edge e in E fails with probability p_e.

Example

The toy problem in Fig. 1(a) of our paper considers a graph G=(V,K,E) with V=[1, 2, 3, 4], K=[1, 4], and E=[(1,2), (1,3), (2, 4), (3, 4)], and edge "down" probabilities P=[0.5, 0.375, 0.5, 0.5]. The input file format for this graph is as follows:

c "c" lines are comments
c problem type
p g
c terminal nodes
T 1 4
c edges and corresponding "up" probabilities
e 1 2 0.5
e 1 3 0.625
e 2 4 0.5
e 3 4 0.5

To compute the unreliability u of the graph, construct the CNF file issuing:

$ python -m relnet example_graph.txt example_graph.cnf
[relnet] CNF file "example_graph.cnf" saved
[relnet] Number of sampling variables is 6
[relnet] For counting issue:
         $  approxmc example_graph.cnf

If you install ApproxMC, you can compute the count issuing:

$ approxmc example_graph.cnf
...
[appmc] FINISHED AppMC T: 0.02 s
[appmc] Number of solutions is: 33 x 2^0

Finally, the unreliability is u = (33 * 2^0 ) / 2^6 = 0.515625

Approximation Guarantees

For a large graph you can set multiplicative error threshold epsilon_val and chance of exceeding it delta_val as follows:

$ approxmc --epsilon epsilon_val --delta delta_val large_graph.cnf

How to Cite

If you use RelNet, please cite these papers PMDV2019 and AAAI17.

relnet's People

Contributors

mahi045 avatar paredesroger 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.