Power systems are operating under stressed condition due to continuous increase in demand of load. This can lead to voltage instability problem when face additional load increase or contingency. In order to avoid voltage instability suitable size of reactive power compensation at optimal location in the system is required which improves the load margin. This work aims at obtaining optimal size as well as location of compensation in the 39- bus New England system with the help of Bacteria Foraging and Genetic algorithms. To reduce the computational time the work identifies weak candidate buses in the system, and then picks only two of them to take part in the optimization. The objective function is based on a recently proposed voltage stability index which takes into account the weighted average sensitivity index is a simpler and faster approach than the conventional CPF algorithm. BFOA has been found to give better results compared to GA.