Git Product home page Git Product logo

savings's Introduction

Savings

This is a simple implementation of the savings heuristic for the capacitated Vehicle Routing Problem. It is tested with some instances from Augerat et al. from the package vrpinstances. The implementation is not specified by any paper, it is just implemented right from my head.

Solution format

Customers are labeled from 2 to n. 1 is always the depot. Solutions are arrays of arrays. The inner array represents a tour with implicit start and end at the depot. [[2,4],[3,5]] for example is a solution where the first vehicle visits 2 and then 4 and the second vehicle visits 3 and then 5.

Usage

Use yarn start to run the algorithm against Augerat et al. instances.
Use yarn test to run tests.

Complexity

This algorithm should run in O(n^3). In each iteration of the while loop every tour is combined with every other tour. The amount of tours can be estimated by n, hence n^2. A combination can be found at most n times because then the solution would be a single tour that visits every customer. So the loop is executed at most n times.

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.