The configuration for distributed generation has an important effect on the reliability and economy of distribution network. For this problem, a mathematical model is founded in this paper, whose target is the minimum active power loss. Besides normal constraints like the node voltage、the node current and the capacity, the maximum short-current level limit is also taken into account, which is a key to ensure that the protection device dose not malfunction. Meanwhile, in order to solve the slow convergence and local optimization problem of genetic algorithms, adaptive genetic algorithm (AGA) is used to optimize the location and sizing of the distributed generation. The necessity for considering relay protection constraint as well as the better convergence and adaptation for AGA are eventually verified by the simulation of IEEE33 bus system example.