Skip to content

Thahit/Simplex_Method_LP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simplex Method Linear Programming

The program is not meant to be extremely optimized but was created to obtain a better understanding of the theory behind the method.

Input

The examples are text files because this allows users to input problems without having to put in the effort of creating some strange matrix, which they might not understand. Also, the inputs are intentionally not very consistent with spaces etc. because this is what is bound to happen when the program would be used. Examples can be found in the examples folder.

Form

The first line is the formula which is to be maximized. Consecutive lines are for constraints. Variables start with letters (e.g., x, y, x2, ...). Each variable should only appear once per line, otherwise the first occurrence is taken. Variables belong to the left side of constraints. Either use "<=" or ">=" for constraints (= constraints can be built by adding both a <= and a >= constraint). The non-negativity constraints "x >= 0" are implied by the program and don't need to be added.

solutions of the examples:

The true solutions and the results of the solver are the same:

  • ex1: 10400
  • ex2: 0.6
  • ex3: unbounded
  • ex4: no solution

Todo

Possible improvements:

  • more flexible variable selection that selects the best improvement but can detect cycles and change to the save selector that has already been implemented.
  • maybe draw graph if 2d
  • maybe also return variable assignment

Releases

No releases published

Packages

 
 
 

Languages