Self-healing (SH) smart grids provide vital intelligence characteristics for timely remedial operations in the case of network failures. Intelligent sensors, smart devices, and contemporary communication technologies are all included into the SH design. Owing to the high cost of SH components, especially the computerized ring main block (SRMU), deployment must be optimized to provide best practices at lowest possible cost. In light of numerous economic concerns, this research presents a unique technique for figuring out the ideal number and placements of SRMUs inside power distribution networks. One important consideration for determining the sites of SRMUs is the connection price for on-grid solar energy (PV) installations. To determine the required number of SRMUs, the technique of nonlinear programming NLP (natural language optimization is used, with a focus on cost/benefit analysis-a crucial consideration for Distribution Corporations (DISCOs). In order to maximize network operating efficiency, the best SRMU sites are also chosen using a combination of integer linear programming (it) optimization, which accounts for the expenses of losses, energy not provided (ENS), and PV disconnection. Interest rates and cable failure rates are taken into account in the process. The Egyptian energy distribution network and an experiment for control center construction using SRMU s are also introduced in the paper. Simulation results showing the effectiveness of the suggested strategy are shown together with application of this approach to a modified IEEE 37-node identified as test feeder of a section of a particular district infrastructure in South Cairo, consisting of 158 nodes with dispersed PV power facilities.