Skip to content

dta12/Big-M-Simplex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Big-M-Simplex

This program is a linear optimization solver that uses the Big M Simplex Algorithm. As of now this implementation only supports finding the max, but we know we can easily convert min problems to max's thanks to duality. Warning:
DO NOT USE THIS ON HOMEWORK. I AM NOT RESPONSIBLE IF YOU FAIL. THIS PROJECT IS A WORK IN PROGRESS.

How to run:

  1. To compile run the command:
    gcc -o simplex simplex.c tabelau.c tokenizer.c
  2. To start the program run the command
    ./simplex or ./simplex.exe
    depending on compiler and OS.

Sample output

This output is from running the current eq.txt file in the repository with the following problem:

x + 2y <= 40
2x + 3y <= 72
-60x - 90y + p = 0

Then when running .\simplex.exe we get the following:

Initial Tabelau:
1.0     2.0     1.0     0.0     0.0     40.0
2.0     3.0     0.0     1.0     0.0     72.0
-60.0   -90.0   0.0     0.0     1.0     0.0 
MAX P = 0.0
------------------------------------------------
Iteration: 1    Pivot chosen: (r: 1, c: 2)
0.5     1.0     0.5     0.0     0.0     20.0
0.5     0.0     -1.5    1.0     0.0     12.0
-15.0   0.0     45.0    0.0     1.0     1800.0
MAX P = 1800.0
------------------------------------------------
Iteration: 2    Pivot chosen: (r: 2, c: 1)
0.0     1.0     2.0     -1.0    0.0     8.0
1.0     0.0     -3.0    2.0     0.0     24.0
0.0     0.0     0.0     30.0    1.0     2160.0
MAX P = 2160.0
------------------------------------------------
The optimal solution has been found
0.0     1.0     2.0     -1.0    0.0     8.0
1.0     0.0     -3.0    2.0     0.0     24.0
0.0     0.0     0.0     30.0    1.0     2160.0
MAX P = 2160.0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages