Giter Club home page Giter Club logo

node-or-tools's Introduction

node-or-tools

Build Status

NodeJS bindings for or-tools Travelling Salesman Problem (TSP) and Vehicle Routing Problem (VRP) solvers.

See API.md for documentation.

Solving TSP and VRP problems always starts out with having a m x m cost matrix for all pairwise routes between all locations. We recommend using the Mapbox Directions Matrix service when optimizing travel times.

Example

Quick Start

npm install node_or_tools
var ortools = require('node_or_tools')

var VRP = new ortools.VRP(solverOpts);

VRP.Solve(searchOpts, function (err, solution) {
  // ..
});

See API.md for interface documentation and the example for a small self-contained example.

We ship pre-built native binaries (for Node.js LTS 4 and 6 on Linux and macOS). You will need a compatible C++ stdlib, see below if you encounter issues. Building from source is supported via the --build-from-source flag.

Ubuntu 16.04

You're fine. The system's stdlib is recent enough.

Ubuntu 14.04

apt install software-properties-common
add-apt-repository ppa:ubuntu-toolchain-r/test
apt update
apt install libstdc++-5-dev

Tests

npm test

Building - Undefined Symbols

If your C++ compiler and stdlib are quite recent they will default to a new ABI. Mason packages are still built against an old ABI. If you see undefined symbols errors force the stdlib to use the old ABI by setting:

export CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0"

and re-build the project.

Releases

  • Push commit with [publish binary] on master
  • Wait for Travis to build and publish binaries, check the AWS bucket if in doubt
  • Tag the release git tag vx.y.z -a on master, git push origin vx.y.z
  • Then npm login, npm publish to npm
  • Make Github Release for tag

References

Routing Interfaces

More or-tools

Tests

Node bindings

License

Copyright © 2017 Mapbox

Distributed under the MIT License (MIT).

node-or-tools's People

Contributors

daniel-j-h avatar andrewharvey avatar danpat avatar chaupow avatar heystenson avatar carlosen14 avatar springmeyer avatar ivosabev avatar jariz avatar sobinsunny avatar

Watchers

James Cloos 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.