P201 23:31:30 13 FEB
INTERACTIVE LINEAR PROGRAMMING
01 JAN 2017

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.

SimpleX's two-phase simplex input window with a filled 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.

SimpleX displaying a solved tableau and iteration controls

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.

SimpleX's graphical solution view showing constraint lines and the current point

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.

View the project on GitHub