As it is a new challenge for reactive power optimization reactive power optimizationto bring distributed generators (DGs) into electric distribution network, this paper researches the reactive power optimizationin electric distribution network including DGs. The randomness of DG output results in the randomness of the node voltage in the electric distribution network including DGs, the DG's incorporation into grid, therefore, becomes very significant to the uncertainty analysis of electric power system. Random power flow algorithm is adopted in this paper to figure out the probability distribution of each node, and the model, with the objective function of active network loss minimization based on the chance constraints, is established, under the condition of the secure voltage margin. Improved gravitational search algorithm (IGSA) is adopted to conduct the simulation analysis in the IEEE-33 node standard test system, and the result indicates that, compared with the routine gravitational search algorithm (GSA), IGSA can effectively solve the reactive power optimization problem in electric distributed network, avoiding the premature convergence.