Nowadays, vaccination is the most effective way to control the epidemic spreading. In this paper, an epidemic SEIRV (susceptible-exposed-infected-removed -vaccinated) model and an evolutionary game model are established to analyze the difference between mandatory vaccination method and voluntary vaccination method on heterogeneous networks. Firstly, we divide the population into four categories, including susceptible individuals, exposed individuals, infected individuals and removed individuals. Based on the mean field approximation theory, differential equations are developed to characterize the changes of the proportions of the four groups over time under mandatory vaccination. Then through the analysis of the differential equations, the disease-free equilibrium point (DFE) and the endemic disease equilibrium point (EDE) are obtained. Also, the basic reproduction number is obtained by the next-generation matrix method and the stability analysis of the equilibrium points is performed. Next, by considering factors such as vaccination cost, treatment cost and government subsidy rate, differential equations are established to represent the change of vaccination rate over time. By analyzing the final vaccination coverage rate, we can get the minimum vaccination cost to make infectious disease disappear. Finally, the Monte Carlo method is used for numerical simulation to verify the results obtained from the theoretical analysis. Using the SARS-Cov-2 pandemic data from Wuhan, China, the experimental results show that when the effectiveness rate of vaccination is 0.75, the vaccination cost is not higher than 0.886 so that the vaccination strategy can be spread among the population. If mandatory vaccination is adopted, the minimum vaccination rate is 0.146.