Power loss is one aspect of an electric power system performance indicator. Loss of power can have an impact on poor voltage performance at the receiving end. DG integration in the network has become one of the more powerful methods. To get the maximum benefit from synchronizing the system with DG, it is necessary to ascertain the size, location, and type of DG. This study aims to determine the capacity and location of DG connections for DG type I and type II. To address the aim of this paper, a metaheuristic solution based on a firefly algorithm is used. FA can cover up the lack of metaheuristic algorithms that require a long computational time. To ensure that the load bus location solution is selected as the best DG connection location, the input of the load bus candidate has been filtered based on stability sensitivity. The proposed method is tested on IEEE 30 buses. The optimization results show a decrease in power loss and an increase in bus voltage, which affects an increase in system stability by integrating three DG units. FA validation of the evolution-based algorithm shows a significant reduction in computational time.