Solution (source code)

= Solution
{c}

The entries in the two slack columns give the inverse basis <matrix>
$$
B^{-1}=\begin{pmatrix}1/3&-1/3\\1/3&2/3\end{pmatrix},\qquad
B=\begin{pmatrix}2&1\\-1&1\end{pmatrix}.
$$
Thus the ordered basic variables are $x_3,x_1$. Multiplying the original coefficient <matrix> and right-hand side by $B^{-1}$ gives the completed constraint rows. With the bottom row defined as reduced costs $c^T-c_B^TB^{-1}A$ and right-hand entry $-c_B^TB^{-1}b$, the complete tableau is
$$
\boxed{\begin{array}{rrrrr|r}
0&-1&1&1/3&-1/3&2/3\\
1&3&0&1/3&2/3&14/3\\\hline
0&-6&0&-1/3&-5/3&-26/3
\end{array}.}
$$
This bottom-right entry is the negative of the optimal objective under this row-operation convention. If a tableau records the positive objective value separately in that position, it is $26/3$; the completed constraint rows and reduced costs are the same.