Giter Site home page Giter Site logo

rationalsimplex.jl's Introduction

RationalSimplex.jl

Build Status

Julia implementation of the Simplex algorithm for rational numbers. Intended for educational and experimental purposes only. See code for documentation, or tests for examples.

Last updated on 2018/07/01, tested with Julia 0.7-beta.

rationalsimplex.jl's People

Contributors

iainnz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rationalsimplex.jl's Issues

Invalid solution if artificial variables are still in basis after phase one

A problem in the current implementation: after phase 1 an artificial variable can still be in the basis (with value 0). Such variables need to be driven out of the basis before starting phase 2, otherwise they might become non-zero in phase 2, which will make the solution invalid.

This is explained here:

Drive artificial variables out of the basis: If l-th basic variable is artifi­cial examine l-th row of B^−1 A. If all elements = 0 ⇒ row redundant. Otherwise pivot with non-0 element.

The following program demonstrates this issue. The returned solution violates the constraints:

A = [
	1//1     1        0        0        0;
	0        0        1        1        0;
	1        0        1        0        0;
	0        1        0        1        1;
	0        0        0        0        1;
];
c = vec([0//1        1        1        0        0]);
b = vec([1//2 1//2 1 1 1 ]);

(status,sol) = simplex(c, A, b); # already in standard form
println(A * sol == b);   # prints false, should be true

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.