Comments (1)
How are you getting to your solution?
var solver = require("../../src/solver");
var fs = require("fs");
var problem = `
-879.0803237290603u + 879.0803237290603v + x <= -10.39070749736004
1120.9196762709396u + -1120.9196762709396v + x >= 10.432946145723236
-1502.7648401132958u + 1502.7648401132958v + y <= -10.90813093980978
1497.2351598867044u + -1497.2351598867044v + y >= 10.95036958817309
u - v >= -1
min: u + v
`;
//
// Convert the standard form of an LP
// into a JSON model that this library can
// make use of; and log it
//
var problem = solver.ReformatLP(problem);
console.log(problem);
/*************
{
opType: 'min',
optimize: '_obj',
constraints: {
__1: { max: -10.39070749736004 },
__2: { min: 10.432946145723236 },
__3: { max: -10.90813093980978 },
__4: { min: 10.95036958817309 },
__5: { min: -1 }
},
variables: {
u: {__1: -879.0803237290603, __2: 1120.9196762709396,__3: -1502.7648401132958,__4: 1497.2351598867044,__5: 1,_obj: 1},
v: {__1: 879.0803237290603,__2: -1120.9196762709396,__3: 1502.7648401132958,__4: -1497.2351598867044,__5: -1,_obj: 1},
x: { __1: 1, __2: 1, __3: 0, __4: 0},
y: { __1: 0, __2: 0, __3: 1, __4: 1}
}
}
***************/
//
// Solve the problem...
// and log it
//
var data = solver.Solve(problem);
console.log(data);
/***
{ feasible: true, result: 0.01181998, bounded: true, u: 0.01181998 }
*///
Which also seems to tie out when you model it in excel:
I'm going to close this; but if this doesn't solve your issue, please feel free to re-open.
Thanks,
-JWW
from jslpsolver.
Related Issues (20)
- HTML JS usage HOT 2
- Constraints as expressions using variable attributes? HOT 3
- How to formulate quadratic optimization in the json model?
- Solver doesn't resolve
- Number.EPSILON undefined in Internet Explorer
- Feasibility Analysis HOT 4
- Documentation: Webpack IgnorePlugin
- What should I do if I want to know the value of every materials
- Number of Variables
- Uncaught ReferenceError: Solver is not defined HOT 2
- Get some data in array
- Cannot solve simplest 2-dimensional example HOT 1
- how can i use this in blending problem
- Implementing bounds for each variable HOT 2
- Multi-Objective Optimization
- Prefer to spread variable decision
- Does this package support taking the max/min of an average?
- published package includes 50 megs of test data
- Potential security issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jslpsolver.