I use Tikz with Matrix because I need to draw arrows and write on and beside the matrix. However, I don´t control the coordinates well other than using trail and error. For instance in the matrix below I have put an X at (0,0) and it is not in the centre of the matrix. However, if the matrix is 4x4 than it is in the centre. Is there any convenient way to know the coordinates?
\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\matrix(m) [matrix of math nodes, nodes in empty cells, nodes={minimum size=1cm, outer sep=0pt, text height=1.5ex, text depth=.25ex}]
{
36 & & 32 & & 33 & \\
& & & & & \\
10 & & 8 & & 7 & \\
& & & & & \\
12 & & 17 & & 16 & \\
& & & & & \\
23 & & 15 & & 16 & \\
& & & & & & \\
};
\draw (m-1-1.north west) rectangle (m-8-6.south east);
% Lineas horizontales
\foreach \i in {2,4,6,8} {
\draw (m-\i-1.south west) -- (m-\i-6.south east);
}
% Lineas verticales
\foreach \j in {2,4,6} {
\draw (m-1-\j.north east) -- (m-8-\j.south east);
}
% dual ui
\node [font=\color{red}] at (3.5,3) {$\ge 10$};
\node [font=\color{red}] at (3.5,1) {$\ge 8$};
\node [font=\color{red}] at (3.5,-1) {$=4$};
\node [font=\color{red}] at (3.5,-3) {$=3$};
% dual vj
\node [font=\color{red}] at (-2.5,-5) {$\le12$};
\node [font=\color{red}] at (-0.5,-5) {$=12$};
\node [font=\color{red}] at (1.5,-5) {$=6$};
\node [font=\color{red}] at (0,0) {X};
\end{tikzpicture}
\end{document}