Skip to content

Latest commit

 

History

History
38 lines (32 loc) · 779 Bytes

README.md

File metadata and controls

38 lines (32 loc) · 779 Bytes

Build Status

DEPRECATED ⛔

This repo is not maintained anymore. Please see glpk.js for an alternative.

node-glpk

Node.js native module for GLPK.

Install

$ nvm use
$ npm install

Test

$ npm run test

Example

var glp = require("glpk");
var prob = new glp.Problem();
 
prob.readLpSync("todd.lpt");
prob.scaleSync(glp.SF_AUTO);
prob.simplexSync({presolve: glp.ON});
if (prob.getNumInt() > 0){
  function callback(tree){
    if (tree.reason() == glp.IBINGO){
      // ...
    }
  }
  prob.intoptSync({cbFunc: callback});
}
console.log("objective: " + prob.mipObjVal());
prob.delete();