Given a population with m heterogeneous subgroups, a method is developed for determining minimal vaccine allocations to prevent an epidemic by setting the reproduction number to 1. The framework is sufficiently general to apply to several epidemic situations, such as SIR, SEIR and SIS models with vital dynamics. The reproduction number is the largest eigenvalue of the linearized system round the local point of equilibrium of the model. Using the Perron-Frobenius theorem, an exact method for generating solutions is given and the threshold surface of critical vaccine allocations is shown to be a compact, connected subset of a regular (m-1)-dimensional manifold. Populations with two subgroups are examined in full. The threshold curves are either hyperbolas or straight lines. Explicit conditions are given as to when threshold elimination is achievable by vaccinating just one or two groups in a multi-group population and expressions for the critical coverage are derived. Specific reference is made to an influenza A model. Separable or proportionate mixing is also treated. Conditions are conjectured for convexity of the threshold surface and the problem of minimizing the amount of vaccine used while remaining on the threshold surface is discussed.