Simplex Solver solves linear programs given an arbitrary number of constraints. Learn more about the Simplex Algorithm.
To see the Simplex Solver in action, take a look here: simplex.samduvall.com.
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: [...]}
npm install simplex-solver
Maximizes equation
such that it meets all of the constraints
.
equation
- A stringconstraints
- An array of strings. The operator for each constraint can be either<=
,>=
or=