  For a positive integer $m>1$, if the generalized Markoff equation
$a^2+b^2+c^2=3abc+m$ has a solution triple, then it has infinitely many
solutions. We show that all positive solution triples are generated by a finite
set of triples that we call minimal triples. We exhibit a correspondence
between the set of minimal triples with first or second element equal to $a$,
and the set of fundamental solutions of $m-a^2$ by the form $x^2-3axy+y^2$.
This gives us a formula for the number of minimal triples in terms of
fundamental solutions, and thus a way to calculate minimal triples using
composition and reduction of binary quadratic forms, for which there are
efficient algorithms. Additionally, using the above correspondence we also give
a criterion for the existence of minimal triples of the form $(1, b, c)$, and
present a formula for the number of such minimal triples.
