A Python-based Simplex Method Solver for linear programming problems. This tool allows users to input an objective function and constraints, and it solves the linear programming problem using the Simplex method.
- Input objective function and constraints
- Formulate and display the linear programming model
- Perform Simplex method iterations
- Display intermediate and final Simplex tables
- Handle fractions and floating-point numbers
- Python 3.x (Download it here)
- Downloading Python is required to run this program since it is written in Python
- git (Download it here)
- git is required to be able to install this project seamlessly into your computer
-
Clone the Repository:
git clone https://github.com/lirrnaiad/Simplex-Method-Solver.git cd Simplex-Method-Solver
-
Create a Virtual Environment:
python -m venv venv
-
Activate the Virtual Environment:
- On Windows:
venv\Scripts\activate
- On macOS/Linux:
source venv/bin/activate
- On Windows:
-
Install Dependencies:
pip install -r requirements.txt
-
Run the Script:
python simplex.py
-
Input the Objective Function:
Enter objective function: z = 120x + 100y
-
Input the Number of Constraints:
Enter the number of constraints (excluding non-negativity constraints): 2
-
Input Each Constraint:
Enter constraint 1: 2x + 2y <= 8 Enter constraint 2: 5x + 3y <= 15
-
View the Formulated LP Model:
LP Model: Max 120x + 100y subject to the constraints 2x + 2y <= 8 5x + 3y <= 15 x, y >= 0
-
View the Initial Simplex Table:
Initial table: +-----+-----+-----+-----+-----+-----+ | B.V | x | y | S1 | S2 | RHS | +-----+-----+-----+-----+-----+-----+ | S1 | 2 | 2 | 1 | 0 | 8 | | S2 | 5 | 3 | 0 | 1 | 15 | | z | -120| -100| 0 | 0 | 0 | +-----+-----+-----+-----+-----+-----+
-
Follow the Simplex Method Iterations:
- The program will display each step of the Simplex method, showing the intermediate tables and the pivot operations.
-
View the Final Simplex Table and Solution:
- The program will display the final Simplex table and the optimal solution for the given linear programming problem.