In Gas Metal Arc Welding (GMAW) process, one of the main goals is to reach high depth of penetration as a characteristic of quality. This requires high amount of input heat. On the other hand high amount of input heat causes the increase in dimensions of heat affected zone (HAZ) which is not desirable. In this paper, an objective function including both depth of penetration of weld bead and the width of heat affected zone namely F = (HAZ+t) / (P+t) has been considered where, HAZ, P, and t denote the width of heat affected zone, the depth of penetration, and thickness of test pieces respectively. A five level five factor rotatable central composite design was used to collect the data for depth of penetration and width of heat affected zone. After collecting the data, the regression equation of objective function was obtained as a function of wire feed rate, welding voltage, nozzle-to-plate distance, welding speed and gas flow rate using least squares method. Then the objective function (f) was minimized by using the Imperialist Competitive Algorithm. One can be sure that the width of HAZ will decrease and the depth of penetration will increase due to minimization of the objective function. The computational result demonstrates that the proposed optimization algorithm is quiet effective in minimizing the objective function. The result shows that in order to obtain higher depth of penetration and lower width of heat affected zone at the same time, wire feed rate, arc voltage and nozzle-to-plate distance must be at their lowest levels while welding speed and gas flow rate should be at their highest levels.