Electricity deregulation has caused rapid changes in electricity market structure. Vertically integrated utility which performed all the functions including generation, transmission, distribution and retail services are now disaggregated into separate companies devoted to each function. The main goal of this deregulation is to enhance competition and provide new choices and economic benefits to the consumers. In a deregulated environment, determination of Market Clearing Price (MCP) is the main objective of a pool operator. Market Clearing Price is based on bids received from the generators as well as consumers. The Independent System Operator (ISO) finds out the Market Clearing Price based on these bids from generators and consumers. The calculation of market clearing price using conventional methods is not suitable for spot market as they are slow and less efficient. In this paper, optimum generation cost is determined using metaheuristic optimization techniques like firefly algorithm and particle swarm optimization and comparative analysis of optimum generation is also carried out using these techniques. Optimum location of DG is also determined in this work. Both fixed and variable demands are considered in this paper. IEEE standard 9 bus system is taken as the test system and the programming is carried out using MATLAB platform (R2014a).