or-tools-wasm examples

GitHub: or-tools-wasm npm package version

or-tools-wasm lets you run Google OR-Tools directly in the browser. OR-Tools is a mathematical optimization library: it helps choose the best plan when there are many possible choices, rules, and tradeoffs.

You can use it for problems like planning delivery routes, assigning people to tasks, packing items under limits, scheduling work, or making the best use of limited resources. This WebAssembly package makes those solvers available from JavaScript and TypeScript, so demos and browser-based planning tools can run without a separate solver backend.

Source code is available on GitHub, and the package is on npm.

MathOpt (frontend)

Use MathOpt to route one model through selectable solver backends.

MPSolver (frontend)

Use MPSolver to route one linear model through selectable LP and integer backends.

CP-SAT

Use CP-SAT for discrete optimization problems with integer, Boolean, scheduling, and logical constraints.

Routing

Use routing for vehicle routing, traveling salesperson, pickups and deliveries, capacities, and route constraints.

Network Flow

Use OR-Tools graph algorithms for max-flow, min-cost-flow, and linear sum assignment problems.

GLOP

Use GLOP for continuous linear programs through the MPSolver API.

CLP

Use CLP for continuous linear programs through the MPSolver API.

GLPK

Use GLPK for continuous and mixed-integer linear programs through MPSolver, or as a MathOpt backend.

SCIP

Use SCIP for mixed-integer linear programs through MPSolver.

CBC

Use CBC for mixed-integer linear programs through MPSolver.

BOP

Use BOP for Boolean and integer programming models through MPSolver.

Knapsack

Use the dedicated Knapsack API for 0-1 and multi-dimensional knapsack problems.

Set Cover

Use the dedicated Set Cover API for weighted set covering models and OR-Tools covering heuristics.

RCPSP

Use the CP-SAT-backed RCPSP API for resource-constrained project scheduling.

GSCIP

Use GSCIP for SCIP-backed mixed-integer optimization through MathOpt.

SAT

Use the SAT integer backend for MPSolver mixed-integer linear models.