  Let K be a complete, algebraically closed nonarchimedean valued field, and
let f(z) in K(z) be a rational function of degree d at least 2. We give an
algorithm to determine whether f(z) has potential good reduction over K, based
on a geometric reformulation of the problem using the Berkovich Projective
Line. We show the minimal resultant is is either achieved at a single point in
the Berkovich line, or on a segment, and that minimal resultant locus is
contained in the tree in spanned by the fixed points and the poles of f(z).
When f(z) is defined over the rationals, the algorithm runs in probabilistic
polynomial time. If f(z) has potential good reduction, and is defined over a
subfield H of K, we show there is an extension L/H in K with degree at most (d
+ 1)^2 such that f(z) achieves good reduction over L.
