GithubHelp home page GithubHelp logo

eoanodea / daddd-assignment Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 3.93 MB

This project is a set covering problem for unmanned aerial vehicle (UAV) to cover a set of targets. The problem is formulated as a mixed integer linear programming (MILP) model and solved by Gurobi solver.

Jupyter Notebook 100.00%
gurobi matplotlib networkx set-covering-problem

daddd-assignment's Introduction

๐Ÿ›ฐ๏ธ Unmanned aerial vehicle set covering problem

โœ๏ธ Introduction

Individual assignment for the Data Analytics & Data Driven Decisions course.

This project is a set covering problem for unmanned aerial vehicle (UAV) to cover a set of targets. The problem is formulated as a mixed integer linear programming (MILP) model and solved by Gurobi solver.

Based on the Paper Unmanned aerial vehicle set covering problem considering fixed-radius coverage constraint, the model is extended to only consider the fixed-radius coverage constraint.

The idea behind this problem is to asssit in a region during disaster recovery. Where demand_points are people in need of aid within a certain region, how many UAVs are required to cover all demand points, based on the radius of the UAVs (coverage_radius).

๐Ÿ“ฆ Installation

The following packages are required to run the code:

You should also have some sort of Python environment manager installed, such as Anaconda.

๐Ÿ“š How it works

The scp.ipynb file manages all aspects of solving this problem. It starts by generating a set of demand points within a networkx graph, based on the specified regiion width & height, and the number of demand points.

Each demand point is plotted randomly on the graph, the output looks something like this:

Output before optimization

Secondly, we define decision variables, the objective function (to minimize the number of UAVs required), and the constraints, based on the model in the paper:

Sets

  • $N$ = set of demand points
  • $M$ = set of flight position of UAVs

Parameters

  • $b^x_j$ = flight position of UAV $j$ on x-coordinate
  • $b^y_j$ = flight position of UAV $j$ on y-coordinate
  • $\alpha_{ij}$ = binary feasibility of UAV $j$ covering demand point $i$

Decision Variables

$$ y_j = \begin{cases} 1,\quad \text{ if UAV $j$ is used} \\ 0,\quad \text{otherwise} \end{cases} $$

$$ x_{ij} = \begin{cases} 1,\quad \text{ if demand point $i$ is covered by UAV $j$} \\ 0,\quad \text{otherwise} \end{cases} $$

$$ \forall i \in N \ \forall j \in N$$

Objective function

$$ \begin{alignat}{3} & \min \sum_{j \in M}y_j \\ & \text{s.t.} x_{ij} \le y_j \quad && \forall i \in N, \forall j \in M \\ & \sum_{j \in M} \alpha_{ij}x_{ij} \ge 1 \quad && \forall i \in N \\ & x_{ij} \in {0, 1} \quad && \forall i \in N, \forall j \in M \\ & y_j \in {0, 1} \quad && \forall j \in M\end{alignat} $$

Distance

Distance between each demand point is calculated using the Euclidean distance formula: $$\sqrt{(a^x_i - b^x_j)^2 + (a^y_i - b^y_j)^2}$$

$\alpha = 1$ if distance is less than or equal to the coverage radius, $0$ otherwise.

Finally, the model is solved using Gurobi solver, and the output looks something like this:

Output after optimization

In this particiular case, 5 UAVs are required to cover all demand points.

Note: You may notice the number of UAVs flucuate between each run. This is because the demand points are randomly generated within the region every time, and the solver may find a different solution each time.

daddd-assignment's People

Contributors

eoanodea avatar

Stargazers

 avatar

Watchers

 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.