Environmentally friendly energy sources with high power quality or reliability and low costs are regarded as an effective solution for energy supply problems arising from use of conventional methods. Presented in this paper, gives an optimal management strategy of PV/wind/diesel independent hybrid systems for supplying required energy in autonomous microgrids. A new optimization problem is formulated for minimizing the capital investment and fuel costs of the system. To solve the proposed optimization problem a novel algorithm, named Guaranteed convergence Particle Swarm Optimization with Gaussian Mutation (GPSO-GM), is developed. Two operators, namely mutation and guaranteed convergence, are added to PSO in order to help finding more accurate results and increasing the speed of calculations. The performance of the proposed strategy is evaluated in two case studies.