In the context of the smart grid,efforts were made to reduce network loss in distributed generation(DG)distribution networks and enhance grid security.To accomplish this,three security evaluation indexes were proposed."single branch security coefficient","minimum security coefficient",and"average security coefficient".Additionally,a mathematical model for the reconfiguration of the distribution network was established,with network loss,"average security coefficient",and"minimum security coefficient"as the objectives.The problem is addressed using an improved rat swarm optimization algorithm.To address the issue of excessive iterations in the random initial population of the traditional rat swarm algorithm,an ordered ring network was utilized in conjunction with heuristic rules to generate an initial solution during the initialization stage.To mitigate the problem of generating numerous invalid variations during the operation process,a"mapping rule"was proposed to maximize the utilization of rat swarm variation rules.Moreover,an"optimal individual fine-tuning strategy"was introduced to ensure that the final result is optimized to the best possible outcome,avoiding suboptimal solutions.Finally,the proposed method is validated through simulations using the IEEE33 node system and Taipower84 node system to assess its generality and effectiveness.