node.js - 有没有人见过 javascript/nodejs 的单纯形库

标签 node.js v8 mathematical-optimization simplex

我一直在用 NodeJs 编写很多脚本,但我需要使用类似 GLPK 的东西库,以便处理我脚本中的一些优化。有人听说过 javascript 驱动程序吗?我想知道将 coin 移植到 V8 库会有多难……可能高于我的工资等级。

最佳答案

不确定它是否是 OP 正在寻找的,但我正在做一些事情 here那可能有用。你会像这样使用它:

var solver = new Solver,
    results,
    model = {
    optimize: "profit",
    opType: "max",
    constraints: {
        "Costa Rican" : {max: 200},
        "Etheopian": {max: 330}
    },
    variables: {
        "Yusip": {"Costa Rican" : 0.5, "Etheopian": 0.5, profit: 3.5},
        "Exotic": {"Costa Rican" : 0.25, "Etheopian": 0.75, profit: 4}
    }
};

results = solver.solve(model);
console.log(results);

结果最终会是:

{feasible: true, Yusip: 270, Exotic: 260, result: 1985}

它可能不是世界上最快的求解器,但它很容易使用。

关于node.js - 有没有人见过 javascript/nodejs 的单纯形库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6445736/

相关文章:

node.js - 验证类验证器中的空白区域

artificial-intelligence - 你想解决哪些优化问题?

javascript - node.js 的基准测试

python - 波利亚猜想的反例

optimization - Haskell 中的二次规划

css - 通过 node.js 和 MEAN 堆栈编译 LESS?

node.js - sinon - 创建返回自己参数的 stub

node.js - 在 Node.js 中操作从数据库中获取的数字的最佳/最合适的方法

javascript - Google 的 V8 引擎真的限制每个进程 1 个 VM 吗?

v8 - V8 是否支持 Unicode?