Is there some algorithm for calculating the least number of generators of an ideal in a polynomial ring?

My question comes from the context of algebraic geometry. By Krull's principal ideal theorem, the number of generators of the defining ideal of a variety gives an upper bound of its codimension.

Suppose now we are given a finite set of polynomials $f_i$ in the polynomial ring $k[x_1,\cdots,x_n]$, where $k$ is a field. Is there some kind of algorithm giving the least number of generators of the ideal $I$ generated by $f_i$'s? Moreover, can we get the minimal generator set explicitly? What about the similar problem for homogeneous ideal and homogeneous generators?