An efficient and reliable evolutionary-based meta-heuristic approach, termed as swarm intelligence, is presented for the solution of optimal power flow with both continuous and discrete variables. The continuous control variables are unit-active power outputs and generator-bus voltage magnitudes, while the discrete variables are transformer tap settings and switchable shunt devices. Particle swarm optimization, a new evolutionary computation technique based on swarm intelligence, is illustrated for two case studies of IEEE-30 bus system and 3-area IEEE RTS-96 system. Both normal and contingency states are considered for the optimal power flow solution. The feasibility of the proposed method is compared with a simple genetic algorithm. The algorithm is computationally faster, in terms of the number of load flows executed, and provides better results than other heuristic techniques. © Indian Institute of Science.