Safety and congestion management of electricity systems is an essential concern in competitive markets. The operation of a transmission system within the operating limits is also the main task performed by system operators. In this research, a novel strategy for preserving the integrity of the system while decentralizing power market activities is described. The interior point method, integrated with evolutionary particle swarm optimization, also known as IPM-EPSO, is utilized in order to solve the optimal power flow problem, which aims to maximize the social benefit and system safety in the event of a contingency that is selected to be the most severe possible for the network. The effectiveness of the approach proposed was demonstrated by modified 14-bus IEEE systems for a specific loading condition, subject to contingency. The results show that under the selected network contingency conditions, the proposed technique IPMEPSO can effectively improve system security.