Skip to main content
Contents Index
Calc
Dark Mode Prev Up Next
\(\newcommand{\N}{\mathbb N} \newcommand{\Z}{\mathbb Z} \newcommand{\Q}{\mathbb Q} \newcommand{\R}{\mathbb R}
\newcommand{\mc}[1]{\multicolumn{1}{c}{#1}}
\DeclareMathOperator{\cone}{cone} \newcommand{\x}{\mathbf x} \newcommand{\y}{\mathbf y} \newcommand{\z}{\mathbf z}
\newcommand{\vc}{\mathbf c} \newcommand{\vb}{\mathbf b}
\newcommand{\vs}{\mathbf s} \newcommand{\vt}{\mathbf t} \newcommand{\p}{\mathbf p} \newcommand{\q}{\mathbf q}
\newcommand{\ec}[1]{\enclose{circle}{#1}} \DeclareMathOperator{\lcm}{lcm} \newcommand{\eb}[1]{\enclose{box}{#1}}
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\definecolor{fillinmathshade}{gray}{0.9}
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
\)
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*}