Simplex is an iterative algorithm for solving linear-programming problems, which I learnt about while studying Further Maths at Sixth Form. While interesting, working through it on paper can be slow, as each question involves several large tableaus and a single arithmetic mistake can be hard to spot after a few iterations. So to help with my revision I built a program to step through and visualise the calculations.
Data input
The C# Windows Forms application accepts one-phase and two-phase simplex problems. Users start by filling in their initial tableau.
Stepping through the calculation
Once a problem has been solved, SimpleX displays the result tableau and lets users step through the solution iterations.
Decimal representation
One interesting aspect of the solution is that users can choose whether to see values as fractions or decimals. This was difficult to implement but was particularly worthwhile: it made the intermediate values easier to compare with handwritten working and avoided unnecessary rounding problems.
Plotting tableaus
For two-variable questions, SimpleX also draws a graphical interpretation of each stage, which can be interesting to watch as the algorithm explores the feasible region and considers solutions.
Printing
Not only can step-by-step calculations be printed, but I also included the ability to generate and print blank tableaus for practice.
Summary
This project is a prime example of how you can get hooked on a problem. This was one of my first experiences building a GUI application and it exposed me to a lot, including accurate modelling of mathematical calculations. Given more time, I would improve the interface and add a mode that checks a student’s own working one step at a time.