  There exists a bijection between the set of Latin squares of order $n$ and
the set of feasible solutions of the 3-dimensional planar assignment problem
($3PAP_n$). In this paper, we prove that, given a Latin square isotopism
$\Theta$, we can add some linear constraints to the $3PAP_n$ in order to obtain
a 1-1 correspondence between the new set of feasible solutions and the set of
Latin squares of order $n$ having $\Theta$ in their autotopism group. Moreover,
we use Gr\"obner bases in order to describe an algorithm that allows one to
obtain the cardinal of both sets.
