This repository contains an implementation of the Simplex Method for solving linear programming problems, written in C. The program calculates the optimal solution to a linear optimization problem given constraints and an objective function.
Features :
-
Solves linear programming problems in standard form.
-
Handles multiple variables and constraints.
-
Provides the optimal solution and the maximum value of the objective function.
-
Detects unbounded problems and displays appropriate warnings.
How to Use :
-
Clone the Repository
git clone https://github.com/yourusername/simplex-method-c.git cd simplex-method-c
-
Compile the Program
gcc simplex.c -o simplex
-
Run the Program
./simplex
-
Input Format
- Enter the number of variables in the objective function.
- Enter the number of constraints.
- Provide:
- Coefficients of the objective function.
- Coefficients and constants for the constraints.
Code Overview :
- simplex(): Core function implementing the Simplex algorithm.
- main(): Handles user input and invokes the simplex() function.
Limitations :
Only works with problems in standard form (all constraints are ≤). Assumes input data is valid.
Contributing :
Contributions are welcome! Feel free to fork the repository, make improvements, and submit a pull request.
License :
This project is licensed under the MIT License. See the LICENSE file for more details.