Application of the Monte Carlo method to deep-penetration transport problems often requires a biasing technique based on the use of an importance function. Here, in the framework of a multigroup model, we use an importance function in the form Ig([arrow over]x, [arrow over]) = eKg[arrow over].[arrow over]x[varphi]g([arrow over]), where g is the energy group index that ranges from 1 to G and [arrow over] is a vector usually fixed empirically. We describe an algorithm to find a good set of coefficients Kg and a good set of functions [varphi]g. To do this, we solve a system derived from the homogenous adjoint equations. We give two numerical examples where we show how these importance functions can enhance the accuracy of the computation.