我一直在NodeJs中编写很多脚本,但我需要使用像
GLPK库这样的东西来处理脚本中的一些优化.有没有人听说过javascript驱动程序?我想知道将硬币移植到V8库有多难…可能高于我的工资等级.
解决方法
Javascript Simplex库
> SimplexJS
> SimpleSimplex
> YASMIJ.js
YASMIJ示例:
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}}"