Giter Site home page Giter Site logo

jeremyfourna / warehouse-path Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 2.0 6.31 MB

Lib allowing you to compare routing algorithm performance for warehouse picker tour.

JavaScript 100.00%
warehouse pathfinding picker traveling-salesman picker-tour picker-path warehouse-path

warehouse-path's Introduction

warehouse-path

Lib that allow you to build to best picket tour inside a warehouse for a given list of locations to visit. Inside a warehouse a picker must pick during his/her tour 40 to 60 products, those products are located across many locations, warehouse-path allow you to define the best way to go throught all locations and minimize the length of the tour.

Installation

npm i --save warehouse-path

Usage

const R = require('ramda');

const {
  nbSteps,
  shortestClosestNeighbourPath,
  shortestPathViaEllipse,
  shortestSShapedPath,
  warehouseMatrix,
} = require('../index');

///////////////////////////////////
// Create your warehouse matrix //
/////////////////////////////////

const matrix = warehouseMatrix(44, 36, [10]);

/////////////////////////////////////////////////
// Define your picker tour via your locations //
///////////////////////////////////////////////

const pickerTour = ['MZ1-0115A03', 'MZ1-0122A01', 'MZ1-0332A03', 'MZ1-2531A03', 'MZ1-2813D05', 'MZ1-2816D04', 'MZ1-2913D05', 'MZ1-3019D01', 'MZ1-3334A02', 'MZ1-3341A02', 'MZ1-3517A03', 'MZ1-3529A01', 'MZ1-3227A02', 'MZ1-0715A01'];

///////////////////////////////////////////////
// Define your starting and/or ending point //
/////////////////////////////////////////////

const sortingArea = 'MZ1-2444A01';

/////////////////////////////////////////////////////////////////////////////////////
// Define your custom function to transform your locations into matrix data point //
///////////////////////////////////////////////////////////////////////////////////

// testLocationToMatrixData :: String -> [Number, Number]
function testLocationToMatrixData(location) {
  const val = R.slice(4, 11, location);
  const xAxis = R.subtract(R.multiply(Number(R.slice(0, 2, val)), 3), 3);
  const yAxis = Number(R.slice(2, 4, val));

  if (R.equals(0, R.modulo(yAxis, 2))) {
    return [R.inc(xAxis), R.divide(yAxis, 2)];
  } else {
    return [xAxis, R.divide(R.inc(yAxis), 2)];
  }
}


console.log('S Shaped', nbSteps(shortestSShapedPath(matrix, sortingArea, pickerTour, testLocationToMatrixData)));
console.log('Closest Neighbour', nbSteps(shortestClosestNeighbourPath(matrix, sortingArea, pickerTour, testLocationToMatrixData)));
console.log('Ellipse', nbSteps(shortestPathViaEllipse(matrix, sortingArea, pickerTour, testLocationToMatrixData)));

Will output via the node terminal node example/example-1.js

S Shaped 397
Closest Neighbour 382
Ellipse 347

Those numbers means that each algo will ask the picker to go throught that many steps to complete their picker tour. In the example above the ellipse algo is the best for this given picker tour.

Performance between S-Shaped and closest neighbour algos

alt text

  • S-Shape = S-Shaped
  • Shortest = closest neighbour
  • Difference = closest neighbour steps for a given picker tour minus S-Shaped steps for a given picker tour

The closest neighbour tends to performance better than the S-Shaped and this is even more true as the number of locations in a picker tour increase.

Performance between S-Shaped and ellipse algos

alt text

  • S-Shape = S-Shaped
  • Ellipse = ellipse
  • Difference = ellipse steps for a given picker tour minus S-Shaped steps for a given picker tour

The ellipse tends to performance better than the S-Shaped and this is even more true as the number of locations in a picker tour increase. It also outperform the closest neighbour algo.

Reading list and useful websites

warehouse-path's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

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