All Projects → lovasoa → salesman.js

lovasoa / salesman.js

Licence: Apache-2.0 license
Solves the traveling salesman problem using simulated annealing.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to salesman.js

PyMiniSolvers
A Python API for the MiniSat and MiniCard constraint solvers.
Stars: ✭ 18 (-52.63%)
Mutual labels:  solver
philsol
Simple python library for calculating the modes of electromagnetic waveguides using finite difference frequency domain method.
Stars: ✭ 21 (-44.74%)
Mutual labels:  solver
lpsolvers
Linear programming solvers in Python with a unified API
Stars: ✭ 20 (-47.37%)
Mutual labels:  solver
dae-cpp
A simple but powerful C++ DAE (Differential Algebraic Equation) solver
Stars: ✭ 33 (-13.16%)
Mutual labels:  solver
Hodoku
Hodoku is a solver/generator/trainer/analyzer for standard sudoku.
Stars: ✭ 49 (+28.95%)
Mutual labels:  solver
CapMonsterCloud
a C# wrapper for CapMonster Cloud API
Stars: ✭ 17 (-55.26%)
Mutual labels:  solver
sudokufx
AR Sudoku grabber and solver using JavaCV, JavaFX and Scala
Stars: ✭ 64 (+68.42%)
Mutual labels:  solver
ipc solver
O(N log N)-space IPC solver in OCaml
Stars: ✭ 46 (+21.05%)
Mutual labels:  solver
stlbfgs
C++ L-BFGS implementation using plain STL
Stars: ✭ 21 (-44.74%)
Mutual labels:  solver
fdtd3d
fdtd3d is an open source 1D, 2D, 3D FDTD electromagnetics solver with MPI, OpenMP and CUDA support for x86, arm, arm64 architectures
Stars: ✭ 77 (+102.63%)
Mutual labels:  solver
blt
Lattice-based integer linear programming solver
Stars: ✭ 60 (+57.89%)
Mutual labels:  solver
optaplanner-quickstarts
OptaPlanner quick starts for AI optimization: many use cases shown in many different technologies.
Stars: ✭ 226 (+494.74%)
Mutual labels:  solver
ruzzle-solver
A python script that solves ruzzle boards
Stars: ✭ 46 (+21.05%)
Mutual labels:  solver
flipy
A Python linear programming interface library
Stars: ✭ 23 (-39.47%)
Mutual labels:  solver
GHOST
General meta-Heuristic Optimization Solving Toolkit
Stars: ✭ 28 (-26.32%)
Mutual labels:  solver
glpk.js
GLPK for browser & node
Stars: ✭ 72 (+89.47%)
Mutual labels:  solver
backtrex
Backtracking behaviour to solve discrete problems by brute force
Stars: ✭ 22 (-42.11%)
Mutual labels:  solver
csb
A cloth and soft body simulation library, using position based dynamics.
Stars: ✭ 29 (-23.68%)
Mutual labels:  solver
numberlink
Program for generating and solving numberlink / flow free puzzles
Stars: ✭ 47 (+23.68%)
Mutual labels:  solver
lava-optimization
Constraint Optimization with Lava
Stars: ✭ 23 (-39.47%)
Mutual labels:  solver

salesman

See: demo
Author: Ophir LOJKINE salesman npm module

Good heuristic for the traveling salesman problem using simulated annealing.

salesman~Point

Kind: inner class of salesman

new Point(x, y)

Represents a point in two dimensions.

Param Type Description
x Number abscissa
y Number ordinate

salesman~solve(points, [temp_coeff], [callback=]) ⇒ Array.<Number>

Solves the following problem: Given a list of points and the distances between each pair of points, what is the shortest possible route that visits each point exactly once and returns to the origin point?

Kind: inner method of salesman
Returns: Array.<Number> - An array of indexes in the original array. Indicates in which order the different points are visited.

Param Type Default Description
points Array.<Point> The points that the path will have to visit.
[temp_coeff] Number 0.999 changes the convergence speed of the algorithm: the closer to 1, the slower the algorithm and the better the solutions.
[callback=] function An optional callback to be called after each iteration.

Example

var points = [
      new salesman.Point(2,3)
      //other points
    ];
var solution = salesman.solve(points);
var ordered_points = solution.map(i => points[i]);
// ordered_points now contains the points, in the order they ought to be visited.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].