A Fast Decomposition Method to Solve a Security-Constrained Optimal Power Flow (SCOPF) Problem Through Constraint Handling

This paper presents a decomposition methodology using constraint handling rules to improve the computation time of a security-constrained optimal power flow (SCOPF) problem. In order to evaluate methodology performance, tests over small (500 buses), medium (4,918 buses), and large scale (11,615 buses) transmission networks were carried out. The methodology consisted in the decomposition of the SCOPF problem into a base case problem and contingency sub-problems using constraint handling rules to solve the complete problem in an iterative fashion. The first stage involved solving an OPF problem using a base case network. The second stage dealt with the modification of the initial base case by updating some of the constraint limits according to the evaluation of potentially relevant contingencies. The entire algorithm resorted to parallel computing tools. The methodology, along with active power re-dispatch through droop control and PV/PQ switching in post-contingency scenarios, successfully solved the tested networks with the set of proposed constraints.


I. INTRODUCTION
The security-constrained optimal power flow (SCOPF) problem aims to find an optimal operating cost of power systems while ensuring security criteria (usually N − 1) from a plausible set of contingencies [1]- [5]. SCOPF is a non-linear, non-convex, static, large-scale optimization problem that might also have integer decision variables (generally known as a Mixed Integer Nonlinear Programming -MINLP-optimization problem) [3], [4], [6], [7].
Many different strategies have been explored in the literature to make the SCOPF optimization problem more tractable from a computational point of view. Some of them transform The associate editor coordinating the review of this manuscript and approving it for publication was Zhouyang Ren . the original problem by using linearization, convexification (e.g. quadratic optimization), decomposition strategies (e.g. Alternating Direction Multipliers Method -ADMM, Augmented Lagrangian Method -ALM, Benders Decomposition -BD, etc) and the screening of most relevant contingencies, among others. These strategies usually yield accurate results and relatively low computational burden for electrical networks considered small, i.e. equivalent networks with few buses, branches and elements. However, the implementation of these strategies might oversimplify the original problem (linearization, quadratic optimization) or require time-consuming algorithms that are not suitable for fast, online applications.
In order to solve the SCOPF problem for medium-and large-size networks in an online time frame (less than an hour), this paper presents a computationally-efficient fast decomposition strategy that relies on the constraint handling of the original, time-consuming SCOPF problem by also using parallel computation tools. The main contributions of the proposed methodology are summarized as follows: • This methodology solves the SCOPF problem in an iterative way by modifying the constraint limits of the base case network.
• Complementary constraints such as area Spin Reserve and AGC control are included for feasibility purposes.
• A set of rules for contingency filtering is proposed to reduce computation time.
• The evaluation of each contingency is performed by solving a power flow problem. This approach performs faster than decomposition approaches, which may require the solution of an optimization problem for each contingency.
• The methodology also resorts to power re-dispatch and PV/PQ switching algorithms during the evaluation of each contingency.
The rest of the paper is organized as follows. Section III presents the complete formulation of the SCOPF problem and explains the proposed approach to address it. The methodology and flow diagrams of the implemented algorithms are described in Section IV. Sections V and VI describe the results obtained and the corresponding discussion. Finally, Section VII presents the conclusions and future works based on this research.

II. SECURITY-CONSTRAINED OPF: AN OVERVIEW
The importance of a fast and optimal (or near-optimal) solution to the OPF and SCOPF problems is stressed by organizations such as the North American Electric Reliability Corporation (NERC) and the Federal Energy Regulatory Commission (FERC) [6], [8], [9]. The latter stated that a 5% increase in the efficiency of the algorithms for OPF will yield six billion dollars in savings per year in the United States alone [9]. However, in addition to the complexity of the SCOPF optimization problem, computational burden hugely increases when large-scale networks and many contingencies are evaluated [10], [11], making an NP-Hard problem the worst case [12]. For these reasons, the optimal global condition for the SCOPF problem cannot be ensured in its generic formulation with constrained time [2]. The general classification and the strategies found in the literature to solve the SCOPF problem are described in the following subsections.

A. CLASSIFICATION OF THE SCOPF PROBLEM
The security-constrained OPF problem can be addressed through the preventive (P-SCOPF) and the corrective (C-SCOPF) approaches, or a combination of both (PC-SCOPF). The preventive and corrective models aim to find a minimum cost of operation that is also feasible for all the considered contingencies [5], [7]. P-SCOPF considers no corrective actions in post-contingency states other than those with an automatic response to contingencies (e.g. active power of generators participating in frequency control, automatic tap-changers, reactor banks switching and secondary voltage control) [3], [11]. Examples of P-SCOPF implementation can be found e.g. in [10], [13]. Its major drawbacks are the resulting high operating cost due to the over-tightened feasible region (conservative solution) and a high computation time as a consequence of a large number of contingencies [5], [7], [11], [14], [15].
In contrast, C-SCOPF allows the system operator to re-adjust control variables after a contingency actually occurs to eliminate any violations caused by the evaluated contingencies [5], [7]. This is based on the fact that some power system components (i.e. transmission lines and transformers) would not be affected by short period violations [5], [7]. Examples of C-SCOPF implementation can be found e.g. in [2], [7], [10]. However, most of the proposed formulations for the C-SCOPF problem have not considered the active power droop control, the PV/PQ switching, the lack of modeling of possible corrective control failures, neither the cost of the overall corrective actions [14]- [16].

B. STRATEGIES TO SOLVE THE SCOPF PROBLEM 1) LINEARIZATION AND CONVEXIFICATION
The DC-OPF approximation is the most common linearization technique to solve the SCOPF problem [8], [13], [17], [20]. However, the linear approximation may be inaccurate when using reactive power control variables (shunt reactance, voltage at generator buses) or under highly loaded conditions [3]. Some linearization techniques act directly on the objective function [17] and others include the Successive Linear Programming (SLP) method [2]. Other power system approaches, include transformation of power system data as power measurements to include quasi-real variable magnitudes that allows real and reactive power decoupling to speed up solution in quadratic optimization problems [21].

2) DECOMPOSITION STRATEGIES
These strategies have been proposed to divide optimization problems into subproblems that can be solved easily using e.g. parallel computation tools. The most commonly used algorithms include the Augmented Lagrangian Method (ALM), Alternating Direction Multipliers Method (ADMM), and Benders Decomposition (BD).
ALM in [22] was used to solve a distributed OPF, while in [23] it was used to solve the reactive OPF from network splitting. However, its application to the SCOPF has not been implemented yet.
ADMM has been widely used because it allows the total problem to be divided and makes it parallelizable and easy VOLUME 9, 2021 to implement. This method was used in [17], [22], [24] to solve an OPF. The ADMM was also implemented in [5] to solve a C-SCOPF by testing a set of networks of up to 3,012 buses. However, the number of contingencies and the time to reach a solution was not promising for a real time requirement (3,582 seconds for 4 contingencies).
BD was presented in [10] as an appropriate methodology to divide the C-SCOPF problem, but it was applied only for a 6-bus network. In [1], [6] a 118-bus and 2,351-bus systems were validated, but using a DC model of power flow equations. In [5] BD was also used in a 3,012-bus network, but it considered only 4 contingencies and took 1,165 seconds to reach the solution. [25] showed results for systems of 2,312 and 3,013 buses and up to 990 contingencies using BD.

3) OPTIMIZATION TECHNIQUES
Both the OPF and SCOPF are non-convex problems. Therefore, it is not possible to ensure a global minimum through mathematical programming [26]. Different attempts have been made to reach solutions close to the global minimum through genetic (GA), metaheuristic (MA), and machine learning algorithms. Strategies such as the earthworm optimization algorithm, firefly algorithm tuned through fuzzy logic, and approaches based on historical data are described in [27]- [29] to solve OPF. However, the size of the networks analyzed does not exceed 300 buses and the number of iterations to reach the solution through these strategies cannot be ensured.
Several works have tried to solve non-convex problems through a hybrid optimization strategy. For example, the OPF problem in [26] was solved through GA to group the chromosomes in a search space close to the absolute minimum, and then a continuous Newton-Rhapson method was used to mathematically reach the global minimum; however, overload constraints were not considered. In [7], ALM and ADMM were used to solve the SCOPF in DC. In [14], BD was used to solve PC-SCOPF along with an Evolutionary Algorithm (EA) to select the relevant contingencies; however, only a 118-bus system was tested.

4) CONTINGENCY SCREENING
Another strategy widely used to reduce the size of the SCOPF problem is the contingency filtering [3], [4]. For example, in [30] the umbrella contingencies method was used to select the most relevant contingencies taking into account the magnitude of the Lagrangian multipliers associated with the post-contingency balance constraints. The disadvantage of this approach is that it is necessary to solve the SCOPF first, which makes it infeasible in real time. In [31] a method for contingency evaluation in real time was proposed using weighted digraphs and the central eigenvector of the Laplacian matrix. However, the Laplacian matrix was filled based on the number of overloads caused by the outaged lines, which took too long for a real time approach. EA was used in [14] for contingency filtering, but it demanded a full iteration to identify insecure contingencies. In [2], vulnerability and critical measures were used to select the relevant contingencies in the problem. However, it is necessary to evaluate a power flow for each contingency to carry out this selection, so it makes it infeasible in real time.

III. FORMULATION OF THE SCOPF PROBLEM A. COMPLETE FORMULATION
The SCOPF problem [32] is focused on minimizing the total cost C tot : where G is the set of generators, c g is the generation cost of generator g, c σ is the total constraint violation penalty in base case and c σ k is the total constraint violation penalty in contingency k. K is the set of all contingencies. δ is a weight assigned to the penalty cost in the base case.
For all constraints, the lower and upper bounds of the variable x are denoted respectively as x and x. On the other hand sc denotes a particular scenario of the set SC: where sc = 0 means the base case and sc = i with i > 0 denotes the i-th scenario, which corresponds to the occurrence of the i-th contingency. For the context of this paper, a contingency means the outage of one of the following elements, one at a time (n − 1 contingency): branches (transmission lines, transformers) and generators. The bounds of the decision variables are: where I sc is the set of active buses in scenario sc. v i is the voltage magnitude on bus i.
where G sc is the set of active generators in scenario sc. p g and q g are the active and reactive power of generator g. The considered transmission lines overload constraints are: The considered transformers overload constraints were the following: wherein p o f , q o f , p d f and q d f are the active (p) and reactive (q) power at both ends of transformer f ; superscript o denotes the origin bus, d the destination bus. F sc is the set of transformers in scenario sc. The apparent power rating is defined as S f for transformer f . σ sc,s f is a slack variable that accommodates the apparent power in excess of transformer f 's capacity and is used for penalty calculation, for scenario sc.
The commutable shunts were modeled as generators with null real power. The reactive power constraints were considered as: where q cs i and b cs i are the reactive power and the susceptance value of the commutable shunt on bus i respectively (if it has one). v i is the voltage magnitude on the same bus.
The considered power balance constraints are: for active power, and for reactive power respectively. where p sc L i and q sc L i are the active and reactive load power on bus i in scenario sc. g sc fs i and b sc fs i are the conductance and susceptance of the fixed shunts on bus i in scenario sc. E sc,o and E sc,d are the set of active lines in scenario sc that have bus i as the origin and destination buses respectively. An area spin reserve constraint was considered to prevent the lack of power when generation contingencies occur.
where χ is the set of all generators that appear in at least one contingency and σ A is an area spin reserve slack variable for each affected area A in the base case. The penalization cost of Eq. 1 for scenario sc is computed according to the defined slack variables as follows: (20) The total penalty cost for constraints violation in the base case and in contingencies is given by a piece-wise, linear cost function composed by three regions: small, medium and high penalty values for minor, medium and large amounts of constraint violations respectively. This penalty cost was only related to soft-constraint violations, i.e. all constraints using slack variables (soft-constraint violation variables). Soft-constraints play a relevant role in optimization problems since they allow feasible OPF solutions [33]. Similarly, they represent short time violations that are normally managed by power system operators in near real-time. In this sense, the total penalty cost includes penalties for violations of line apparent current ratings (lines overloading), and penalties for violations of transformer apparent power ratings (transformers overloading). On the other hand, bus voltages and generated active and reactive power belonged to the set of hard constraints. Any hard-constraint violation leads to considering the final solution as infeasible.
According to secondary frequency regulation in multi-area systems, each control area should be able to maintain the frequency according to participation factors predefined by the network operator [34]. After the contingency has occurred in steady state, the active power generated in the sc > 0 scenario must be satisfied for each generator g of the affected area: where P sc g is the real power of the g generator in the affected area to the sc contingency. a g is the participation factor of the generator g. P 0 g is the active power of the generator g in the base case, P sc is the difference of real generation between the base case and the sc contingency.
The PV/PQ switching is performed according to voltage stability criteria when sc > 0. In principle, the voltage control tries to maintain the pre-fault voltage magnitude unless reactive limits are violated [35]: where Q sc g is the reactive power generated variable in the contingency sc, V 0 g and V sc g are voltage magnitude variables in the generators in the base case and contingency sc, respectively.

B. PROPOSED APPROACH
Considering the set of constraints corresponding to each contingency is a computationally demanding problem when a huge amount of contingencies are to be evaluated.
In order to simplify the complete SCOPF problem, the methodology applied in this research pretends to cover the post-contingency restrictions by means of constraint handling in the base case.That is to say, modifying the constraint limits of the base case network. In other words, constraints corresponding to post-contingency violations are not explicitly included in the optimization problem. Instead, the existing base-case constraints are modified iteratively.
According to the latter reasoning, the objective function for the base case is: The lower and upper bounds of the variable x for the iteration m are denoted respectively as x(m) and x(m). The iteration-dependent constraints are therefore: The penalization cost for the base case is computed from the slack variables as follows: where α p , α q , α ef and α σ are penalization functions. Each of these penalization functions satisfies that: The last optimization problem can be summarized as the following vector optimization problem: The IPOPT solver [36] was used to compute the optimal base case in each iteration. In [37], [38] and [39], ipopt has been shown as a high performance algorithm to solve large-scale optimization problems, both to solve SCOPF, OPF and state estimation problems.

IV. METHODOLOGY
The first step of the methodology consists in the decomposition of the SCOPF problem into a base case problem and contingency sub-problems. Several OPF problems were solved through a base case network. The second stage dealt with the modification of the base case by updating some of the limits of constraints (constraint handling) according to the evaluation of potentially relevant contingencies.
An algorithm based on the Matpower toolbox [40] and the Interior Point Optimizer (IPOPT [36], [41]) was proposed to solve the SCOPF problem described in Section III [32], [42]. The algorithm consisted of Pre-and Post-processing stages (input and output data) and other stages classified into three groups: Parallel OPF, Contingencies, and Constraint Handling. Figure 1 shows the approach used to update the constraint limits and to solve the SCOPF problem in an iterative way. The Pre-and Post-processing stages included two blocks named SwShunts to Generators and SwGenerators to Shunts. These blocks treated the switching shunts as generators with null active power before the OPF computation, and then these ''reactive generators'' switched them back to switched shunts before the algorithm delivered the final solution. The other stages, named Parallel OPF, Contingencies, and Constraint Handling, are described in the following subsections. Finally, two stop rules for the loop depicted in Figure 1 were implemented: when the penalty cost was lower than a certain percentage of the objective function or when a number of iterations was reached.

A. PARALLEL OPF
The RunOPF block executed optimal power flows in parallel and is summarized in Figure 2. At this stage, the different combinations for the interior point solver (IPOPT) parameters were set. The initial conditions and tolerance levels of the optimization variables for the linear solvers used (i.e. the Multifrontal Massively Parallel sparse direct Solver (MUMPS [43]), MA57 [44], or MA86 [45]), were combined in multiple workers due to their influence on the convergence time.
If a configuration with a sub-optimal cost is the first to reach a feasible solution, extra time is given to find better solutions. After that, the solution with the lowest cost is chosen to continue towards the Select Contingencies stage.

B. CONTINGENCIES 1) SELECT CONTINGENCIES: RANKING AND SCREENING
The contingency ranking and screening was used as a speed-up strategy for medium-and large-scale networks (i.e. more than 1,000 buses). The strategy was used separately for branches and generation contingencies, as explained in Figure 3.
The indices used in Figure 3 are described below: • Apparent Power (S): main criteria for both branch and generator contingencies.
where: pf : Power factor atan: Four-quadrant inverse tangent function -P, Q: Active and Reactive power • Power Factor Difference (pfd): similar to reactive power difference, the power factor difference was computed between origin and destination terminals.
• Rated Voltage: This criteria sorted branch contingencies according to the highest rated voltage between origin and destination terminals.
• Connectivity: it sorted branches according to the number of elements their buses were connected to. According to the indices shown in Figure 3, the branch contingencies were ranked in 7 different lists, and the generator contingencies in 2 different lists. All lists were sorted in descending order but Power Factor and Connectivity, which were sorted in ascending order and marked with a mark (*) in Figure 3.
Once the branch and generator contingencies are ranked from the most to the least relevant, the positions within each different list are averaged. Elements ranked at the top of several lists are considered relevant. The top x contingencies are therefore selected to continue as the input for the Contingency evaluation stage.

2) RUN SELECTED CONTINGENCIES: EVALUATION
Different workers executed the steps simultaneously as summarized in Figure 4 through parallel computation. First, the contingency applied and conventional power flow were executed with the same load and generated active power as in the base case.
The difference between the total active power generated in the base case and the total active power in the contingency case was a first estimation P, Equation 21. According to this value, the active power set point in post contingency was adjusted based on the participation factors. If a generator tries to exceed its active power limit, it will be saturated and the P value would be increased, neglecting the participating factor of saturated generators.
The differences in active power between the values initially set and the results from power flow evaluation were due to QV violations in some generators. To fix the reactive power violations in PV buses, these were converted to PQ to meet Equation 22. Nevertheless, this could lead to changes in voltage magnitude in PQ buses and power losses in the system.
According to slack deviation, the delta value was recalculated and the power flow was executed again until it reached a minimal deviation.
If there is a reported non-converge power flow situation which enters to the noconv stage in the finite state machine described below.

C. CONSTRAINT HANDLING RULES 1) ITERATION-DEPENDENT FINITE STATE MACHINE
This stage modifies the constraint limits of the base case according to the soft (overloads) and hard (voltage, no convergence) violations identified by the Run Selected Contingencies stage in Figure 1. After the set of selected contingencies is evaluated and the summary of the largest violations is established (overloads, voltage violations, no convergences), the Finite State Machine (FSM) updates the limits of the inequality constraints prior to the next iteration. Figure 5 depicts how the stages of the FMS are selected according to After the FSM selects the proper stage (Overloads, Voltages or NoConvs), the constraints are updated accordingly and the loop returns to the RunOPF stage. If the stage selected by the FSM is End, the loop is interrupted and the general algorithm continues to the Post-processing stage.
The block Select Stage(m) in Figure 5 represents the set of stages (Overloads, Voltages, NoConvs) and logical transitions between them. The stages and transitions of the FSM are explained in detail in Figure 6.
The three stages composing the FSM and their corresponding transitions are explained below.

2) UPDATING CONSTRAINT LIMITS: FSM STAGES AND TRANSITIONS
The constraint limits were tuned depending on the current stage of FSM (see Figure 6). These rules affect the B(m) term in Equation 37.  If the state is overloads, the rules for updating limits shown in Figure 7 will be applied. Branch is used to refer to both transmission lines and transformers.
If the current stage is Voltages, the limit update rule shown in Figure 8 will be applied. In this case, a marginal violation is defined as a violation that meets: The power factor at the origin or destination terminals was validated as another criteria to update the voltage limit. In this case, the voltage can similarly update both under-voltages and over-voltages.
If the marginal voltage or power factor criteria is not met, a new set of constraints will be added in the base case: When the contingency involves a branch such as a transformer or line, these are the additional constraints: q o e < q e max (43) If the state violates maximum or minimum voltages, the limits will be updated according to Figure 8.
Both constraint limit updates in figures 7 and 8 shrink the problem's feasible region after each iteration. Nevertheless, slack variables in bus power balances and line flows reduce the chance of infeasible results. If large magnitudes for slack variables are identified, high penalization cost will appear on the result. The algorithm identifies this situation as infeasible solutions and includes a generation re-dispatch in the base case as described on the figures.
Finally, if the stage of the FSM is non convergence, the strategy will consist in reducing the upper limits P g (25%), R e (10%), s f (10%) depending on whether the element that is in contingency is a generator, a transmission line, or a transformer. In Figure 9 rate A is s f or R e depending if is a transformer or line contingency.

V. RESULTS
The algorithm proposed in this research was implemented through the Matpower toolbox [40] and IPOPT solver [36], [41] to solve the SCOPF problem described in Section III. The set of tested networks are described in Table 1. These datasets were used in the ARPA-E Grid Optimization Competition -Challenge 1. More information about these and other datasets can be found in [42]. Results from the evaluation of the networks listed in Table 1 are presented and discussed below. All the networks tested were run in a 64-bits Linux distribution of Matlab R 2019, Intel(R) Xeon(R) CPU E5-2680 @ 2.70GHz, 128 GB RAM memory and 16 cores.
A set of different initial points were used for the optimal power flow computation. The solver used for the OPF problem was IPOPT [36]. Since the IPOPT methodology strongly depends on the initial point [11], a set of 16 different initial points were proposed to run the OPF algorithm in parallel. Each combination was executed at a different CPU core. These different combinations changed the initial point for the IPOPT solver and included the following fields: • Linear Solver: mumps, ma57 [36]. • Strategy: monotone (default), adaptive [36].
• Oracle: quality function (default), Loqo [36]. • Seed: initialization of decision variables from a base case (warm starting), from ''zero'' condition (cold starting) or from previous algorithm iterations [46], • Initial voltage: from a base case (warm starting) or set to 1 p.u.   To test the performance of contingencies selection (CS), a scenario was tested for each network of Table 1. CS was made for each iteration of the algorithm, leaving a fixed percentage of selection (25%, 50%, 75%, 100%) of the total number of sorted generation and branch contingencies. In each iteration, an evaluation of 100% of the contingencies was carried out in order to determine the total number of violations (overvoltage, undervoltage, overloads) and nonconvergences. In addition, the operating cost of the system was computed by taking into account the penalties for overload and power unbalance. Voltage violations for the k contingency are translated into a power unbalance, according to 32 and 33 equations. To compute the penalization cost, the equation 36 was used with k 1 = 1000, k 2 = 5000, k 3 = 10e6, x 1 = x 2 = 2, and x 3 = 50 Figure 10 shows the normalized cost in logarithmic scale (Cost * ) and violations number in function of the algorithm iterations for the network 1. Different lines indicate the percentage of total set contingencies used for the evaluation. The transformed cost was computed because the unbalance penalization was higher in respect to the minimum cost in the first three iterations, so it was computed as follows:  In all cases, the algorithm ends within 5 iterations. The minimal cost C min was $ 2.63e5. A 50% of CS was enough to achieve a cost with no significant difference from the full contingency evaluation.
The computation time using 25% was 33.08 seconds, and for 100% was 42 seconds. Therefore just a 26% of computation time was increased when 75% more contingencies are evaluated. Figure 11 depicts the costs and number of violations in function of the algorithm iteration for a 4,918-buses network. In this case, the operation cost is minimal for 50% and highest for 75% of CS; nevertheless, the cost difference was less than 2%. For 100% the algorithm saves the best iteration, so the minimal cost is reached in the iteration 5.
In terms of violations, with 50% of CS there were 33 violations and with 100% the algorithm ended with 23. This shows that it is not always cheaper to have fewer violations. In terms of time, for 25% of CS, the algorithm ended with the lowest  time (682s) and the final cost was lower than for 100%. With 75% of CS, there were only 4 iterations, but the computation time was higher than with 25%. In general terms, for a real time approach 25% of CS had an acceptable performance for this scenario.
The normalized cost for network 3 is shown in Figure 12. In this case, a low cost is reached with 50%, 75%, and 100% of CS. With 25%, the penalization is approximately of 64 times higher than the minimal cost.
In Table 2 results for the network 3 are summarized. With 25% the algorithm ends with 22 voltage violations. Although only 0.18% of the total number of the buses is violated, the unbalance cost could be unacceptable. With 50%, 75%, and 100%, the penalty cost of violations could be acceptable. In terms of time and cost, the best performance was reached with 75% of CS. Figure 13 shows the average time per contingency in function of the network size by using 16 and 72 workers. The time differences between them for a 11,615 network is 52 ms/cont, therefore, for 75% (6,560 contingencies) the time would decrease around 341 s per iteration. For four iterations, the computation time would have been about 1,178 s (19.6 minutes) instead of 2,542s, reducing the calculation time by more than twice.
In comparison with [25], the methodology presented here is faster than Benders Decomposition (BD). The average time per contingency for a 2312 buses network is less than 50 ms for 16 and 72 parallel workers, whereas in BD it is about 750 ms.

VI. DISCUSSION
The selection of contingencies strongly depends on the size of the analyzed network. Indeed, the results obtained from network 1 (500-bus system) showed that the selection of contingencies is not convenient for a real-time approach using the proposed methodology. The relevance of contingency selection increases as the network size also increases.
Sometimes the algorithm can steeply increase the costs from one iteration to another (as in the third iteration for 75% selection shown in Figure 12). However, in the next iteration it can return to a better cost. In case it does not improve, the best solution is saved from one iteration to another until the pre-set time of calculation is finished.
The number of cores available for the calculation is another determining factor, since the evaluation of contingencies is the bottleneck of the algorithm. The desired percentage of contingencies could be selected based on the available time, the number of cores, and the number of buses in the network. Once the desired percentage is known, the criteria of Figure 3 will be applied.
According to [10], the decomposition formulation of the SCOPF problem in base case and contingency scenarios improve overall efficiency. In this paper, the decomposition technique is coupled with parallel power flow solution of contingency scenarios, reducing even more the computational time for solution.

VII. CONCLUSION
This article proposes an algorithm capable of solving the Security-Constrained OPF (SCOPF) problem for large-scale networks in a timely manner. This fast decomposition method considered a larger number of buses, elements, and contingencies if compared with the size of networks usually analyzed in the literature. The use of parallel computing techniques served both to reduce the uncertainty of the seed and the solver in the OPF solution and to quickly perform the contingency evaluation stage of the algorithm.
Solving an optimization problem only for the base case of the OPF requires less time compared with strategies such as Bender's Decomposition, which involves solving an optimization problem for each contingency. The proposed methodology only executes conventional power flows, which saves even more time when the number of contingencies is as high as in the evaluated networks.
The criteria for selecting contingencies using the proposed algorithm proved to have good performance. All cases showed that it was enough to select 50% of the contingencies to obtain final costs similar to when 100% of the contingencies were evaluated.
As a suggestion for future work, uncertainty costs could be introduced to model renewable injection, restrictions in storage, and ramp elements to model the limitation of actuators. Additionally, new strategies to update the limits could be researched, aiming at less iterations to reach a lower cost. A network partitioning algorithm could be used to reach a better performance.  DANIEL AGUDELO-MARTINEZ received the B.Sc. degree in electrical engineering and electronics engineering and the M.Sc. degree in electrical engineering from the Universidad Nacional de Colombia at Bogota, Colombia, in 2016 and 2020, respectively. He has been performing electric power systems studies and developed software applications with the consulting firm GERS, since 2019. His consulting activities include among others, assessing the interconnection of distributed energy resources (renewables) to the current and future power grid. His research interests include power systems modeling, optimal operation, power quality, and artificial intelligence applied to power systems monitoring and control.
DARIO ARANGO-ANGARITA received the B.Sc. degree in electrical engineering and the B.Sc. degree in electronic engineering from the Universidad Nacional de Colombia at Bogota, Colombia, in 2016 and 2018, respectively. He currently works as a Data Analyst with Enel Codensa. His research interests include big data, machine learning, power system control, and distributed optimization.
CAMILO ACOSTA-URREGO received the B.Sc. degree in electrical engineering from the Universidad Tecnológica de Pereira, Colombia, in 2011. He is currently the Head of Planning Studies, GERS consulting engineers. His research interests include power system distribution planning, numerical methods, artificial intelligence, applied optimization to energy systems, operations research, and power systems protection.