Coder Social home page Coder Social logo

lucasdiogo96 / routing-optimizer Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 2.0 1.24 MB

This solution was written in python and is based on the vehicle routing problem

Home Page: https://medium.com/neogrid/desmistificando-roteiriza%C3%A7%C3%B5es-com-python-5b80f940a6fb

Jupyter Notebook 100.00%
routing vrp tsp vrp-solver python optimization pandas truck supply-chain delivery

routing-optimizer's Introduction

Routing Optimizer

The solution based on the vehicle routing problem is in this repository described in python by me in notebook format.

Click here to read my article about it on Medium: Desmistificando roteirizações com Python

Type of application

Jupyter Notebook

Built With

Getting Started

1 - For you to run the notebook, you need to have Jupyter installed on your computer or access it in the cloud.

2 - You also need to create a Mapbox account to get the token so you can plot the clustered routes on the map

In the notebook put your token in the following variable

mapbox_token = <Your_Token>

3 - You need to have installed the following packages

3 - Just run It

About the project

I used in the implementation as a reference all the US states as visiting points, the spreadsheet with the data is in the project.

Further explanations about the implementation can be found in the notebook

What is the problem?

Travel salesman problem

One of the most famous and well-known problems in the areas of computer science and operations research is the traveling salesman problem (TSP) which consists of: Given a set of cities and their positions, the problem is to find the shortest route for each city be visited only once and finally return to the starting point.

TSP

The problem can be solved by analyzing each round-trip route to determine the shortest. However, as the number of destinations increases, the corresponding number of round trips exceeds the capabilities of even the fastest computers. With 10 destinations, there can be over 300,000 permutations and round-trip combinations. With 15 destinations, the number of possible routes could exceed 87 billion.

Vehicle routing problem

In the Vehicle Routing Problem (VRP), the objective is to find optimal routes for multiple vehicles visiting a set of locations. (When there is only one vehicle, it boils down to the Traveling Salesman Problem.)

VRP

Vehicle routing problems are inherently intractable: the time required to resolve them grows exponentially with the size of the problem.

But what do we mean by "optimal routes" for a VRP? One answer is the routes with the shortest total distance. However, if there are no other restrictions, the ideal solution is to assign only one vehicle to visit all locations and find the shortest route for that vehicle. This is essentially the same problem as TSP.

A better way to define optimal routes is to minimize the length of the longest single route among all vehicles. This is the right definition if the goal is to complete all deliveries as quickly as possible.

References

Travelling salesman problem

Vehicle routing problem

Google OR-Tools

routing-optimizer's People

Contributors

lucasdiogo96 avatar

Stargazers

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