• determine the optimal capacity, type, number and location of renewable energy resource • Optimal location of the switch for clustering the traditional DN into a set of interconnected MGs • Considering multiple function contains; operation cost, reliability, network structure and environmental factors together • Considering uncertainty to generate and reduce scenario-based modelling. In this paper, a scenario-based strategy for optimizing multiple microgrids has been proposed by considering the demand and renewable energy sources (RES) unit unpredictability. The approach seeks to determine the appropriate capability, category, number, and position of renewable and controllable distributed RES, and the ideal switch site for clustering the traditional distributed network (DN) into a collection of interconnected micro-grids (MGs) with an economical and trustworthy structure. The suggested solution attempts to minimize all plans, counting asset and process expenses, system loss, air pollution, and the cost of microgrid s' unsupplied energy. The Monte Carlo method was adopted to generate and reduce the scenarios, and the Newton-Raphson method was used for power flow. To optimize the system, we used the improved shark smell optimization algorithm in the simulation. Obtained results of economic and reliability assessment demonstrate that by dividing the traditional DNs into a set of multiple MGs, the reductions in reliability costs and technical costs are provided due to the reduction in losses and the improvement of the voltage profile, thereby reducing the total system costs. Also, obtained numerical analyzes show 0.34%, 0.14% and 0.12% improvement, in comparison to genetic algorithms, particle community and artificial bee colony, respectively. [ABSTRACT FROM AUTHOR]