transportation-problem

1.0.0 • Public • Published

🚚 Transportation problem calculator 🚚

What to use this program for❔

With this program you can easly calculate the cheapest cost of delivery products "Transportation Problem" using potentials method.

Geting started 🔨

To use this module you only have to install it via npm ☺️

    npm install transportation-problem

or

    npm i transportation-problem

How to use❔

import { TransportProblem } from "transportation-problem";
 
const tP = new TransportProblem();
 
const exampleDataTable = [
  [1, 3, 6, 4, 10],
  [3, 4, 5, 2, 20],
  [4, 4, 2, 1, 10],
  [6, 4, 2, 4, 10],
  [20, 20, 1, 9, 50]
];
 
tP.create(exampleDataTable);

Possible usage

There is two possible ways to use this program:

  1. One method to get solution
const solution = tp.solution();
// solution = [
//  [10,   null, null],
//  [null, 10,   null],
//  [null, null, 10  ]
//];
  1. The second way is to use the step by step method so that you can study how the minimum transport cost is calculated
const nextStep = tp.nextStep();
 
// nextStep = {
//  data: [],
//  caseIndex = number,
//  desc =String a brief description of what was calculated in this step
// }

This is my first atempt to implement mathematical algorythm in JavaScript so, if You find any bug fell free to send me a message i will try to correct them.

Github Repository

Package Sidebar

Install

npm i transportation-problem

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

14.3 kB

Total Files

3

Last publish

Collaborators

  • adamkrowka