Has anyone seen a simplex library for javascript/nodejs

BHP picture BHP · Jun 22, 2011 · Viewed 10k times · Source

I've been writing a lot of my scripts in NodeJs, but I need to use something like the GLPK libraries in order to handle some of the optimizations in my scripts. Has anyone heard of a javascript driver? I wonder how hard it would be to port coin to a V8 library.. probably above my pay grade.

Answer

Larry Battle picture Larry Battle · Nov 21, 2012

Javascript Simplex Libraries

YASMIJ Example:

var input = {
    type: "maximize",
    objective : "x1 + 2x2 - x3",
    constraints : [
        "2x1 + x2 + x3 <= 14",
        "4x1 + 2x2 + 3x3 <= 28",
        "2x1 + 5x2 + 5x3 <= 30"
    ]
};
YASMIJ.solve( input ).toString();
// returns
"{"result":{"slack1":0,"slack2":0,"slack3":0,"x1":5,"x2":4,"x3":0,"z":13}}"