Code Monkey home page Code Monkey logo

movingfirefighterproblem's Introduction

The Moving Firefighter Problem

The Moving Firefighter Problem (MFP) is a generalization of the original Firefighter Problem presented by Hartnell. It incorporates a function τ that defines the time a firefighter takes to move from one vertex to another. The article that presents this problem is available here: https://www.mdpi.com/2038212

This repository contains the mixed-integer quadratically constrained program (MIQCP) for the optimization version of the MFP for a single firefighter (1-MFP).

  • "run_batch.py" runs the complete batch instances used in the article.
  • "get_D_value.py" finds an upper bound for the defense rounds D.
  • "recursive_function.py" finds the minimum value for the burning rounds B needed to achieve the optimal objective.
  • "verify_function.py" is necessary to ensure that the diffusive process finishes for the defending rounds B.
  • "gens_for_paper.py" contains the seeds used for the paper.
  • "utils.py" and "plots.py" are responsible for the plotting process. The plots are saved in the "img" folder.
  • The "csv_s" folder contains the results obtained by running "run_batch.py," which are reported in the paper.

Link to the article will be available soon:

Bruno R. Gutiérrez-De-La-Paz, Jesús García-Díaz, Rolando Menchaca-Méndez, Mauro A. Montenegro-Meza, Ricardo Menchaca-Méndez, Omar A. Gutiérrez-De-La-Paz. The Moving Firefighter Problem.

To execute the implemented formulations is need to install Gurobi.

Install gurobipy:

Step one: Download and install Anaconda

Gurobi supports Python 2.7 and 3.7 for Windows. However, to run our code install Python 3.X. Please choose the version of Anaconda you wish to download (the download will start automatically):

Once the download is complete, click on it to run the installer.

Step two: Install Gurobi into Anaconda

The next step is to install the Gurobi package into Anaconda. You do this by first adding the Gurobi channel into your Anaconda platform and then installing the gurobi package from this channel.

From an Anaconda terminal, issue the following command to add the Gurobi channel to your default search list:

$ conda config --add channels http://conda.anaconda.org/gurobi

Now issue the following command to install the Gurobi package:

$ conda install gurobi

You can remove the Gurobi package at any time by issuing the command:

$ conda remove gurobi

Step three: Install a Gurobi License

The third step is to install a Gurobi license (if you haven’t already done so).

You are now ready to use Gurobi from within Anaconda. Your next step is to install the instances generators of the Moving Firefighter Problem (MFP)

Moving Firefighter Problem Generator

Running the implemented formulation

Run "run_batch.py." Feel free to change the hyperparameters. Be careful because a more considerable number of nodes in a graph or a smaller lambda value could mean a more considerable running time.

The results are saved in ./Runs/csv_s directory as cvs files divided by the number of nodes in the graph.

movingfirefighterproblem's People

Contributors

brunogupa avatar

Stargazers

Omar Gutiérrez avatar  avatar David Regla avatar Jesús García avatar Roberto E. López avatar

Watchers

Jesús García avatar  avatar Omar Gutiérrez 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.