This study explores the feasibility of using impedance relays in electrical distribution systems, a context where their application is not as common as in transmission systems. Given the dynamic nature and complex topology of medium-voltage distribution systems, this work proposes an innovative methodology integrating clustering algorithms and metaheuristic techniques to optimize the placement of impedance relays and enhance system reliability and resilience. Using CYME simulation and the Ant Colony Optimization (ACO) method, case studies were designed to validate the effectiveness of the proposed methodology. The results demonstrated that strategic placement of impedance relays reduces failure frequency and significantly improves the system’s response to such failures. This approach allows for a more efficient configuration and quicker response, which is crucial for maintaining continuity and quality of power supply. A detailed analysis of system behavior under various fault scenarios illustrates the robustness and adaptability of the proposed solution, marking a significant advancement in the protection and optimization of electrical distribution systems.