A tool for automatically deriving the next simplex table iteration, with respect to the current state and the user-provided pivot.
This tool makes use of a custom fraction class, meaning all values operated on and displayed will be exact rational numbers; not imprecise floating point numbers.
Build an executable using a C++11 compiler. Upon launching the compiled binary, you should be prompted to enter the amount of columns and rows of your table. Afterwards, you will be asked to supply values for each cell.
Once that is complete, you'll be able to perform any of the following commands:
Provide the pivot coordinate, and it will calculate the next table pivoting around that cell.
Throw away the current table, and enter a brand new one.
Provide a coordinate, and the value the corresponding cell needs to be changed to.
Print out LaTeX code for the current table.
Reduce all fractions in the table—dividing the numerator and denominator by their greatest common divisor.
Exit the program.
This program uses genuine fractions; not approximated floating point values. These fractions can easily be entered in the following regex format: -?[0-9]+(\/[1-9][0-9]*)?
. Intuitively, just provide a (possibly negative) numerator, followed by a slash, and then the denominator. Examples are:
-
1/2
$\mapsto \frac{1}{2}$ ; -
-25/5
$\mapsto -\frac{25}{5} = -5$ ; -
42
$\mapsto 42$ ; -
-1048596/1097302
$\mapsto -\frac{1048596}{1097302} = -\frac{524298}{548651}$ .
This tool aids in manually solving linear programming problems using the simplex method, as described in the Combinatoriek en Optimalisering 2023 dictation, by L.C.M Kallenberg, F.M. Spieksma and M.J.H. van den Bergh as part of the decision theory courses of Leiden University's mathematics bachelor's program.
The program iterates simplex tables on the user-supplied pivot. It does so as follows:
Assume an
-
$b_{ij} := a_{ij} - \frac{a_{cj}\ \cdot\ a_{ir}}{a_{cr}}$ for all$(i, j)$ with$i \neq c$ and$j \neq r$ —outside of the pivot row and column; -
$b_{cj} := -\frac{a_{cj}}{a_{cr}}$ for all$j \neq r$ —in the pivot column but outside of the pivot row; -
$b_{ir} := \frac{a_{ir}}{a_{cr}}$ for all$i \neq c$ —in the pivot row but outside of the pivot column; -
$b_{cr} := \frac{1}{a_{cr}}$ for the pivot itself.
Along with this, the names corresponding to the pivot row and column will be swapped.