Giter VIP home page Giter VIP logo

zeroforcingnumber's Introduction

Zero Forcing Number

This program calculates the zero forcing number (and set) of any graph. The zero forcing number is defined as follows:

A subset S of initially infected vertices of a graph G is called forcing if we can infect the entire graph by iteratively applying the following process. At each step, any infected vertex which has a unique uninfected neighbour, infects this neighbour. The forcing number of G is the minimum cardinality of a forcing set in G.

- Kalinowski, Kamčev, Sudakov


Install from PyPI

sage -pip install -i https://test.pypi.org/simple/ zeroforcing

Install from source

sage -pip install .

Test

Install the dependencies for testing

sage -pip install zeroforcing[test]

Build the wavefront code for verification during tests

sage --python3 setup.py wavefront

Install the wavefront code we just built

sage -pip install .

Run the tests

sage --python3 -m pytest [-x]
  • -x flag makes pytest stop after the first failure
  • -h flag will show a section called Zero forcing options:

Import

from zeroforcing import *

Building/Running in Docker

  1. Download Docker from the Docker website
  2. Run docker build -t zeroforcing . in the directory this git repository is located in
  3. Run docker run --rm -it zeroforcing
  4. The package should be automatically installed inside of the container and Sage should be running. Have fun!

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.