SimplexSolverQt is a desktop application designed to solve Linear Programming (LP) problems efficiently. Built with C++ and the Qt framework, it provides a graphical interface for defining and solving optimization problems. A key feature of this application is its visualization capabilities, offering a 3D graphical representation of the feasible region for problems with three variables, alongside comprehensive sensitivity analysis.
- Linear Programming Solver: Solves maximization and minimization problems using the Simplex Method.
- Intuitive User Interface: Powered by Qt, providing a clean and easy-to-use experience for inputting objective functions and constraints.
-
3D Feasible Region Visualization: For problems with three decision variables (
$x_1, x_2, x_3$ ), the application dynamically generates and displays a 3D plot of the feasible region, allowing users to visually grasp the solution space. This visualization clearly depicts the planes defined by each constraint (labeled as S1, S2, etc., corresponding to slack variables) and the vertices of the feasible polyhedron. - Optimal Solution Display: Clearly presents the optimal value of the objective function and the values of decision variables at the optimum.
- Sensitivity Analysis: Provides detailed insights into how changes in the problem parameters (e.g., right-hand side of constraints, objective function coefficients) affect the optimal solution, offering a comprehensive understanding of the problem's.
- Cross-Platform Compatibility: Developed with CMake and Qt, ensuring potential deployment across Windows, macOS, and Linux.
- C++: Core application logic and UI development.
- Qt 6: Modern cross-platform framework for the graphical user interface.
- Eigen: C++ template library for linear algebra, used for efficient matrix operations in calculating feasible vertices.
- Python 3: Utilized for 3D plotting capabilities, invoked as a subprocess.
- Matplotlib: Python plotting library for generating 3D graphs.
- NumPy: Essential library for numerical operations in Python.
- SciPy: Used for spatial algorithms, specifically
ConvexHullfor generating the faces of the 3D feasible region.
- CMake: Build system for managing the project compilation and packaging.
- CPack: Used for creating distributable packages (e.g.,
.msifor Windows).
To build and run this project from source, you will need:
-
CMake (version 3.16 or higher)
-
Qt 6 (with MSVC or MinGW compiler on Windows, depending on your setup)
-
Python 3.x
-
Python dependencies:
numpy,matplotlib,scipy. It is recommended to install these in a virtual environment.python -m venv _python_env # On Windows: _python_env\Scripts\activate # On Linux/macOS: # source _python_env/bin/activate pip install numpy matplotlib scipy
-
Clone the repository:
git clone [https://github.com/Claudia-Rocha-H/SimplexSolverQt.git](https://github.com/Claudia-Rocha-H/SimplexSolverQt.git) cd SimplexSolverQt -
Create a build directory:
mkdir build cd build -
Configure CMake: Replace
C:/Qt/6.x.x/mingw_64with your actual Qt 6 installation path and appropriate compiler (e.g.,msvc2019_64for Visual Studio).cmake .. -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="C:/Qt/6.x.x/mingw_64"
- Note for Linux/macOS: You might just need
cmake ..or specify your Qt installation path differently.
- Note for Linux/macOS: You might just need
-
Build the project:
cmake --build . --config Release
After building, the executable SimplexSolver.exe (on Windows) will be located in the build/Release (or build) directory.
Before running, ensure that the _python_env directory (containing your Python installation and required libraries) and the grafico3D.py script are correctly placed relative to your executable, as per the CMakeLists.txt installation rules. For a development setup, you can often run directly from build/Release.
The project includes CPack configurations for creating installers.
-
Run
windeployqt(Windows only): This step copies necessary Qt DLLs next to your executable. Navigate to your build directory (e.g.,build/Releaseorbuild).cd path/to/your/SimplexSolverQt/build/Release # or build windeployqt SimplexSolver.exe
-
Generate the package using CPack: From your
builddirectory:cpack -G WIX # For Windows MSI installer (requires WiX Toolset) # cpack -G DragNDrop # For macOS .dmg # cpack -G DEB # For Debian/Ubuntu .deb package # cpack -G TGZ # For a .tar.gz archive
The generated installer will be in your
builddirectory.
- Launch the
SimplexSolverapplication. - Input the objective function coefficients and the number of variables/restrictions.
- Define each constraint by entering coefficients and the right-hand side value.
- Click "Calculate" to solve the Linear Programming problem.
- View the solution tableau, optimal values, and sensitivity analysis.
- The program visualize the feasible region for 2 and 3 variables problem.
Contributions are welcome! I'm still working on this program and it has some bug with the deployments, f you have suggestions for improvements or bug fixes, please open an issue or submit a pull request.
This project is licensed under the MIT License.
Below, you can find visual demonstrations of the program's functionality:
This animation illustrates how the solution is presented for a two-variable problem:
For problems involving three variables, a 3D graphical representation of the feasible region is generated:
Claudia Rocha https://github.com/Claudia-Rocha-H/ email: [email protected]

