This is a practical project of the software engineering course of the College of Computer Science of Sichuan University.
This application is designed to help users solve Linear Programming (LP) problems and Optimization Problems using the Simplex Algorithm. The Simplex Algorithm is an efficient method for solving LP problems that involve finding the maximum or minimum of a linear function subject to a set of linear inequalities.
The application is built using JavaFX, providing an interactive graphical user interface (GUI) for easy problem input, calculation, and result visualization.
- Linear Programming Solver: Solve LP problems involving multiple constraints and objective functions.
- Simplex Algorithm Implementation: The core algorithm that helps in efficiently finding the optimal solution to linear programming problems.
- Interactive GUI: User-friendly interface with input fields for constraints, objective function, and other parameters.
- Result Display: Once the algorithm converges, the application shows the optimal solution and its corresponding objective function value.
To run the application, the following are required:
- Java Development Kit (JDK): Java 22.
- JavaFX: Ensure JavaFX is installed and configured in your development environment.
- IDE: Any IDE that supports JavaFX, such as IntelliJ IDEA, Eclipse, or NetBeans.
- Clone the repository or download the source code.
- Ensure that your Java development environment is set up with JavaFX.
- Open the project in your preferred IDE.
- Build and run the project.
-
Input Data:
- Enter the objective function (maximize or minimize).
- Add the constraints by specifying the inequalities and their coefficients.
- Choose the type of problem (e.g., maximization or minimization).
-
Start Calculation:
- Click the Solve button to begin the Simplex Algorithm process.
- The application will display the intermediate steps, including pivot operations and changes in basic and non-basic variables.
-
View Results:
- After the algorithm completes, the optimal solution (if one exists) will be displayed, showing the values of the decision variables and the corresponding optimal objective value.
- Graphical representation of the feasible region and optimal solution will be shown (for two-variable problems).
Maximize:
Subject to:
- Enter the number of variables and constraint functions 2 and 2 in the text input.
- Input the coefficient of each function.
- Input the objective function.
- Choose the solution type maximum.
- Hit the Solve button to begin the Simplex algorithm.
- The app will solve for the optimal values of
x
andy
and display the optimal value ofZ
.
The Simplex Algorithm is an iterative method used to solve linear programming problems. It operates on a standard form of the LP problem and moves from one vertex of the feasible region to an adjacent one in such a way that the objective function is improved (maximized or minimized) at each step.
There are currently some bugs in this algorithm, especially solving minimum problem
- Simplex Algorithm reference: Wikipedia - Simplex Method
- JavaFX documentation: JavaFX Documentation