Coder Social home page Coder Social logo

vehicle-routing-problem-with-open-routes-in-python's Introduction

Vehicle Routing Problem with open routes in python

This repository contains a solution to the Vehicle Routing Problem (VRP) in python. In this problem there are 100 customers to be served and a main depot. Each customer asks for products of a specific weight. In the depot there are 15 vehicles with capacity of 1500kg and 15 vehicles with capacity of 1200kg. The vehicles travel at 35km/h and the unloading time of goods in every stop is 15 minutes. Our goal is to satisfy all customers by creating routes using the vehicles we have. One customer will be visited and satisfied by only one vehicle. Each route starts at the depot and finishes at the last customer(open routes) and should not last longer than 3.5h.

Obgective: Minimize the total distance of all routes

In order to solve this problem we wrote a modified version of the Apply Nearest Neighbour algorithm. In this method we find the closest node to the depot and add it to the route if the time and capacity constraints are met. If not we move on to the next nearest neighbour node and check again. Once the first route is created we find the closest node to the depot that we haven't visited yet and repeat as described above. The process is repeated until all routes are created. Our initial solution had an obgective: distance= 1629.

Then we decided to improve our initial solution by writing a modified version of the Local Search algorithm using the move type: Relocation.The algorithm checks all the possible relocations of the already constructed routes. The code was modified in order to satisfy open routes. After the application of this algorithm our objective dropped at distance = 1403.

At last, we decide to give our algorithm a final touch by applying a modifiled version of the Variable neighborhood search algorithm. The VND method uses three move types: Relocation, Two-Opt and Swap-Move. In the Two-Opt, the method will compare every possible valid combination of the swapping mechanism. In the Swap-Move, the method checks all the possible swaps of the already constructed routes. The code was modified in order to satisfy open routes. We tried all the 6 possible combinations of move types, such as R-S-2. After the application of this algorithm our objective dropped at distance = 1267 and the best combination was S-2-R.

We hope this project has proven useful! Thanks for reading!

vehicle-routing-problem-with-open-routes-in-python's People

Contributors

catiaxag avatar elenatzerefou avatar vasilikikaragianni 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.