simplex-solver
v0.0.3
Published
Solves Simplex Equations
Downloads
41
Readme
Simplex Solver
Simplex Solver solves linear programs given an arbitrary number of constraints. Learn more about the Simplex Algorithm.
Live Example
To see the Simplex Solver in action, take a look here: simplex.samduvall.com.
Code Example
To use Simplex Solver in your own application, follow the example below.
var simplex = require('simplex-solver');
var result = simplex.maximize('2x + 3y + 4z', [
'3x + 2y + z <= 10',
'2x + 5y + 3z <= 15'
]);
The example above will yield the following object
result = {max: 20, x: 0, y: 0, z: 5, tableaus: [...]}
Install
npm install simplex-solver
Documentation
simplex.maximize(equation, constraints)
Maximizes equation
such that it meets all of the constraints
.
Arguments
equation
- A stringconstraints
- An array of strings. The operator for each constraint can be either<=
,>=
or=