# Generate Simplex Tableaux With Octave

## Background

It’s easy that one makes careless mistakes in a pivot operation. As a result, in test/exams in which calculators are allowed, I used a simple program to save time.

Answering linear programming question on Mathematics Stack Exchange, I used GNU Octave to do the tedious work.

## Initial tableau

First write the LPP in standard form. I assume that $b$ and $c$ are column vectors.

• c is the objective function.
• A is the coefficient matrix of the constraints. (a.k.a technology matrix)
• b is the RHS of the constraints.
• T0 is the initial tableau.

My habit is to

1. place $b$ on the RHS;
2. place the objective function row at the bottom;
3. omit the coefficient for $z$ since it’ll never be changed.

## Current simplex tableau

The command basis = [3 2 6] is used to choose the decision variables $x_3,x_2$ and $x_6$ as the basis. Note that the order of the entries in the array basis is very important. By setting this array, I don’t need to repeat typing the same set of numbers for $B$ and $c_B$.