  Let $F \in \mathbb{Z}[x_0, \ldots, x_n]$ be homogeneous of degree $d$ and
assume that $F$ is not a `nullform', i.e., there is an invariant $I$ of forms
of degree $d$ in $n+1$ variables such that $I(F) \neq 0$. Equivalently, $F$ is
semistable in the sense of Geometric Invariant Theory. Minimizing $F$ at a
prime $p$ means to produce $T \in \operatorname{Mat}(n+1, \mathbb{Z}) \cap
\operatorname{GL}(n+1, \mathbb{Q})$ and $e \in \mathbb{Z}_{\ge 0}$ such that
$F_1 = p^{-e} F([x_0, \ldots, x_n] \cdot T)$ has integral coefficients and
$v_p(I(F_1))$ is minimal among all such $F_1$. Following Koll\'ar, the
minimization process can be described in terms of applying weight vectors $w
\in \mathbb{Z}_{\ge 0}^{n+1}$ to $F$. We show that for any dimension $n$ and
degree $d$, there is a complete set of weight vectors consisting of
$[0,w_1,w_2,\dots,w_n]$ with $0 \le w_1 \le w_2 \le \dots \le w_n \le 2 n
d^{n-1}$. When $n = 2$, we improve the bound to $d$. This answers a question
raised by Koll\'ar. These results are valid in a more general context,
replacing $\mathbb{Z}$ and $p$ by a PID $R$ and a prime element of $R$.
  Based on this result and a further study of the minimization process in the
planar case $n = 2$, we devise an efficient minimization algorithm for ternary
forms (equivalently, plane curves) of arbitrary degree $d$. We also describe a
similar algorithm that allows to minimize (and reduce) cubic surfaces. The
algorithms are available in the computer algebra system Magma.
