Skip to main content
Logo image

Section 3.3 Solving NonCanonical Problems with Sage

In Section 2.4, we showed how to use Sage to solve canonical linear optimization problems with the Simplex Algorithm. In this section, we use Sage to solve noncanonical problems.

Activity 3.3.1.

Say we want to solve the noncanonical linear optimization problem:
\begin{align*} \textbf{Minimize: } f(\mathbf{x}) & = 3x+y+2z\\ \textbf{subject to: } x+2y+3z& \geq 24\\ 2x+4y+3z& = 36\\ y, z& \geq 0. \end{align*}

(a)

Record this noncanonical problem using Sage:

(b)

Find the optimal solution:
Note that we use the command InteractiveLPProblem rather than InteractiveLPProblemStandardForm for general (potentially noncanonical) linear optimization problems. Sage does not have a command for the Simplex Algorithm for InteractiveLPProblem.

Activity 3.3.2.

Solve:
\begin{align*} \textbf{Minimize: } f(\mathbf{x}) & = -5x+y-2z\\ \textbf{subject to: } 2x+z& = 0\\ x-y& \geq 1\\ 3x-y+z& \leq 3. \end{align*}