Giter Site home page Giter Site logo

Help with API about simplexjs HOT 4 CLOSED

iainnz avatar iainnz commented on September 26, 2024
Help with API

from simplexjs.

Comments (4)

IainNZ avatar IainNZ commented on September 26, 2024

Currently you'd need to reformulate to standard computational form yourself.
I hope to add a basiic modelling language, and make the algorithm competitive, one day.

from simplexjs.

LarryBattle avatar LarryBattle commented on September 26, 2024

So what do I do next after converting to standard computational form?

maximize z = x1 + 2x2 - x3
where
slack1 + 2x1 + 2x2 + x3 = 14
slack2 + 4x1 + 2x2 + 3x3 = 28
slack3 + 2x1 + 5x2 + 5x3 = 30

Side note:
You might be able to use my library. But it's still in beta and rather heavy.
https://github.com/LarryBattle/YASMIJ.js

Example:

// Input

var type = "maximize",
 z = "x1 + 2x2 - x3",
 constraints = [ 
    "2x1 + 2x2 + x3 <= 14", 
    "4x1 + 2x2 + 3x3 <= 28", 
    "2x1 + 5x2 + 5x3 <= 30" 
]
Input.parse( type, z, constraints).convertToStandardForm().toString();

// outputs
"maximize z = x1 + 2x2 - x3, where slack1 + 2x1 + 2x2 + x3 = 14, slack2 + 4x1 + 2x2 + 3x3 = 28, slack3 + 2x1 + 5x2 + 5x3 = 30"

from simplexjs.

IainNZ avatar IainNZ commented on September 26, 2024

You build an object, and set number of variables, number of constraints, the dense A matrix, b vector, c vector, and x lower and upper bounds. Check out the TSP example.

from simplexjs.

IainNZ avatar IainNZ commented on September 26, 2024

Your code looks like it could be configured to work with it. It seems you are using the full simplex method with rational numbers, judging by the output?

from simplexjs.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.