An overall control strategy for power flow optimization is defined. In normal and alert states, reactive power control variables are used to minimize transmission losses and improve the reactive power security level, respectively. In the emergency state, any type of constraint violation is eliminated by using reactive power control variables to eliminate voltage violations and real power control variables to eliminate line overcurrents. Complete decoupling between real and reactive power flows is assumed, and coordination between the real and reactive power control variables is used to eliminate any type of constraint violations. The problem is linearized using simplified and constant sensitivity relationships, and the optimal solution is obtained using dual simplex linear programming with a relaxation technique. Test results on the IEEE-39 bus and the IEEE-118 bus systems have been included to show the effectiveness of the algorithm.