Modern distribution systems consist of various distributed generators (DG) to make reliable power system. In this DG integrated distribution systems, coordination of overcurrent relays is a big challenge for protection engineers. At addition of DG, distribution system experiences change in the short circuit level of the system and thus earlier relay settings causes mal operation of relays. Nowadays, various programming optimization techniques are frequently used to find optimal relay settings of overcurrent (OC) relays. This paper presents a comparative study of Particle Swarm Optimization (PSO) and Gravitational Search Algorithm for the coordination of overcurrent relay for a system containing DG. A proper combination of primary and backup relay is selected to avoid mal operation of relays and unwanted outages when DG is penetrated. A four bus radial system is simulated in PSCAD/EMTDC platform and programming is done using MATLAB software.