Skip to content

Implementation of the Simplex method for Linear Programming problems.

Notifications You must be signed in to change notification settings

eduardovegas/Simplex_Calculator-Cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Simplex Calculator in C++

This project implements the Simplex Algorithm for solving Linear Programming problems.

Compiling and Running

A serial executable is obtained by using your favourite C++ compiler to compile and link the downloaded files. For example, using g++:

g++ main.cpp -o main.exe

After done compiling, execute the 'main' program passing the LP problem data file as an argument, like this:

./main.exe entrada/DadosXX.esd

If no argument is passed, the program will read the LP problem from the user itself.

Creating the Data

To pass the problem as an argument to the calculator, it needs to be in the specific format below, so that the Data class can read the file correctly:

NAME: name of your file or problem.

p_t: specifies the problem type -> (0) for Maximization, (1) for Minimization.
n_v: number of variables in the Objective Function (OF).
n_c: number of constraints.

Z = XX XX XX.. (OF)
XX XX XX.. < RHS (Constraint 1)
XX XX XX.. = RHS (Constraint 2)
XX XX XX.. > RHS (Constraint 3)

'<' is read as '<='.
'>' is read as '>='.
RHS holds the value of the Right-Hand Side of that constraint.
Each XX specifies the coefficients of the variables from the OF.

Customizations

To not show the Tableau of each iteration on the Simplex calculator, use '//' to comment all print line and 'printarTabela()' at 'Simplex::calcularSimplex()'.

To not go through the Right-Hand Side analysis, use '//' to comment 'rhsAnalysis()' at 'Simplex::printarResultado()'.

About

Implementation of the Simplex method for Linear Programming problems.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages