Optimal Power Flow (OPF) is an important operational and planning problem in minimizing the chosen objective functions of the power systems. The recent developments in power electronics have enabled introduction of dc links in the AC power systems with a view of making the operation more flexible, secure and economical. This paper formulates a new OPF to embrace dc link equations and presents a heuristic optimization technique, inspired by the behavior of fireflies, for solving the problem. The solution process involves AC/DC power flow and uses a self adaptive technique so as to avoid landing at the suboptimal solutions. It presents simulation results of IEEE test systems with a view of demonstrating its effectiveness.