To maximize the benefits among loads and to economically allocate the capacities of distributed generators(DGs),a game model for DGs-loads in microgrid based on the firefly algorithm(FA)is proposed.Firstly,the game model for DGs-loads as well as the objective functions under non-cooperative and cooperative games,is developed after careful consideration of the relationships between DGs costs,DGs capacities,loads costs and load electricity consumptions.Then,the application of FA in the game iterative process is designed.The parameters of attraction and brightness in FA are applied to update the game strategy for optimizing the objective functions.Finally,the improved Shapley method is proposed to redistribute the total income in order to ensure the stability of cooperation.The two coefficients income fine-tuning coefficient and stability index are presented to find the optimal distribution solution.The feasibility of the game model in load optimization and effectiveness of FA in solving game equilibrium are validated through an analysis of benefits between DGs and loads.