An Extended Optimal Transmission Switching Algorithm Adapted for Large Networks and Hydro-Electric Context

Previous works have shown that the best topology of an electrical network depends on the total demand and its distribution. Optimal Transmission Switching (OTS) identifies lines to be opened to minimize operating costs. However, this cost-based criterion is not suitable for hydropower generation-based companies, where hydrology largely dictates the power generation. Moreover, no study about impact of OTS on voltage stability margins have been conducted in literature as it never been explicitly integrated in the problem formulation. Thus, OTS does not guarantee that proposed topologies are secure even if voltage bounds are respected. It also does not take full advantage of the real networks flexibility by including only line states and production distribution in the control vector. This leads to algorithms that are not suitable for weakly meshed (or mostly radial) networks. In this paper, we propose an extended OTS (E-OTS) that includes several improvements over current algorithms and overcomes the above-mentioned problems. We also propose two heuristics to reduce resolution time. Results on the PEGASE (1354 bus) and Polish (2236 bus) networks show that E-OTS identifies a topology improvement in less than 40 minutes, which is low enough to be implemented in a real energy management system. Tests have been made for three different criteria.


I. INTRODUCTION
The best network's topology in terms of cost is not necessarily the nominal one, where all lines are active. In fact, it changes and depends on the current production and load distributions. Optimal transmission switching (OTS) consists in finding the production distribution that minimizes the operating costs of a network considering that state of lines may be controlled in addition to power generation. The idea of changing line status to eliminate overloads or to correct voltage limit violations have been described repeatedly in the literature under the name of transmission switching (TS) [1]- [5]. TS algorithms are generally used to fast-calculate corrective actions, The associate editor coordinating the review of this manuscript and approving it for publication was Ali Raza .
whereas the OTS is presented as a near real-time planning tool like the optimal power flow (OPF) [6].
The first OTS paper showed that substantial economy can be obtained with the use of OTS in the case of a congested network [6], suggesting that there exists an optimal topology for every situation. Several papers have since come to the same conclusion [7]- [9]. Nevertheless, the proposed algorithms were based on a DC model of the network, which has been proven to be ineffective because many DC solutions are in fact infeasible or fail to reduce costs in AC [10]. Further papers showed how to filter DC solutions given by the OTS to choose only those that are feasible in AC [11]- [13]. However, these algorithms do not provide DC infeasible or bad solutions that are in fact good AC solutions.
In [14], a conic programming approach of the OTS problem is proposed to take reactive powers and voltages into account in the resolution, which improves results. In [15], a full AC formulation of the OTS problem is used with a simple heuristic to accelerate resolution, which finally allows an integration of losses, reactive powers and voltages into the problem.
However, voltage stability margins have never been explicitly integrated in the problem formulation. Thus, OTS does not guarantee that proposed topologies are secure even if voltage bounds are respected. Also, OTS uses a cost-based minimization criterion that leads to weak results when there is no congestion. Moreover, this criterion is not suitable for hydroelectric companies, where hydrology largely dictates the power generation. Therefore, the capacity of OTS to outperform OPF in reducing network losses or increasing loadability should be evaluated, which has not been the case in previous literature.
Current OTS also don't take advantage of the real networks flexibility by including only line states and generation dispatch in their control vector. This leads to algorithms that are not suitable for weakly meshed (or mostly radial) networks.
In this paper, we propose an extended OTS (E-OTS) that includes several improvements over current algorithms and overcomes the above-mentioned problems. First, it ensures that loadability will be maintained or improved by using a set of constraints in the problem formulation. It also uses a general minimization criterion that includes losses and loadability terms, thus allowing the algorithm to be used in a predominantly hydrogeneration context. To take the network's real flexibility into account, the proposed E-OTS includes shunt & series compensations state and variable transformers tap position in the control vector, along with lines state and power generation. This increases the number of possible topologies for a given situation and leads to practical solutions which cannot exist without the new degrees of freedom. Finally, we propose two heuristics that allow parallelization to reduce resolution time and consequently allow the proposed algorithm to identify a topological change in less than 40 minutes on large networks. The maximum size of the network depends on the number of available CPU cores.
The paper is organized as follow. In section II, we demonstrate that OTS may reduce costs at the expense of network loadability, even when voltage & transit limits are respected. However, we show that many alternative topological changes that keep or improve stability while reducing costs exist. This observation leads to the first voltage stability constrained OTS (VSC-OTS). In section III, we show that optimal transmission switching may be used instead of OPF for losses reduction or voltage stability margins (or loadability) increase, which allows OTS to be used in a hydroelectric context. The inclusion of reactive device control in the formulation is presented in section IV and performance assessment of the MINLP implementation of the E-OTS is done in section V. It is shown that the proposed algorithm leads to good results, but resolution time is prohibitive. Section VI describes two heuristics that use parallelization to allow E-OTS to be used on larger networks. Results on large networks (up to 2236 bus & 2896 lines) are shown in section VII and section VIII concludes this paper.

II. ADDING VOLTAGE STABILITY CONSTRAINTS A. VOLTAGE STABILITY INDEX
To study the impact of OTS on voltage stability margins, an indicator must be used. As OTS is based on a static model of the network, the index used must be static and involve only information available in the network model (voltages, powers, impedances, etc.). It must also tell how far from the nose of the PV curve each line operates.
In [16], the LSZ index is developed and compared to the FVSI [17] and LQP [18]. LSZ is based on the exact discriminant of the receiving end voltage quartic equation (quadratic in terms of the squared receiving end voltage) without neglecting losses, and is given by where i and j are the ''from'' and the ''to'' buses of the line, respectively, ψ is the LSZ value, and Z ij is the impedance of the line. As it is based on the discriminant of the receiving end voltage equation, an operating point on the PV curve of the line exists only for 0 ≤ ψ ij ≤ 1. It is an indication of ''how far'' from the nose of the PV curve, or how far from the loadability limit the line operates. Thus, LSZ is a static index that uses only available information and successfully tells if a topological change reduces loadability (if the index increases) or not (if it decreases). It will be used to assess the impact of OTS on voltage stability.  Table 1 shows potential candidate lines considered for a first opening on the IEEE 118 bus test case for two load scenarios VOLUME 8, 2020 (100%, and 110% of the initial load). The IEEE 118 bus test case has been selected mainly because it is the most used in the field [6], [7], [10], [14], [15], [19]. As in [15], the definition data of the system have been taken from [20], except for the cost information and the thermal limits of lines, where information from [21] have been used. Thermal limits have been further modified to create more congestion, but also to create a power distribution across the network that fragilizes non-congested lines in terms of voltage stability (or loadability). In the new line settings, rate A limit is 220MW for all lines except for lines 12 and 15 (500MW), line 13 (400MW) and lines 85, 114, 117-119 (130MW). Results of Table 1 have been obtained by opening each line of the IEEE 118 bus network and executing an OPF on the resulting topology. Losses and maximum LSZ value have been calculated for each topology.

B. TENDENCY OF OTS TO FRAGILIZE THE NETWORK
For each load case, the results for the best five candidates, followed by the initial topology and the worst feasible one, are shown. In the normally loaded case, the nominal topology (all lines closed) is ranked 70th on the 176 feasible ones with a cost of 1273.66$/h, whereas in the heavily loaded cases, full topology is ranked 66th on 138 feasible solutions with 2650.13$/h. The best topology in terms of costs is obtained by opening line 112 between buses 65 and 68 for the normal load, and line 63 between buses 38 and 65 for the 110% load, which gives costs of 1129.15$/h (-11.3%) and 1512.48$ (-42.9%), respectively.
In terms of loadability, resulting maximum value of LSZ vary from one candidate to another. In the normally loaded scenario, opening the best candidate implies that the network maximum LSZ passes from 0.449 to 0.700, which means that opening the best candidate brings the network closer to the nose of the PV curve for at least one line of the network. In this case, the network is weakened by the OTS. However, table 1 shows that if line 56, 50, 54, 60 or 71 was opened instead of line 112, the network would not be weakened by the topological change, but it would imply a smaller costs reduction (or a cost increase in the case of line 71). In the heavily loaded case, OTS opens line 63 as it is the best candidate from the cost reduction point of view. This choice does not fragilize the network. Opening line 50, 111, 56, 54 or 95 does not fragilize the network either.
Results of table 1 shows that a line opening does not necessarily imply a reduction of voltage stability margins as intuition may suggests. Some topologies keep of even increase margins. Fig. 1 and Fig. 2 show the results of 15 successive line openings for normal and heavy loads, respectively. As it can be seen, candidates selected by the OTS increase the maximum LSZ value of the network after one or two openings in both load cases, thus confirming that OTS tends to reduce stability margins when many lines are opened successively.   of the network is selected at each iteration instead of the most economical one. This case represents a Voltage Stability Constrained OTS (VSC-OTS). As it can be seen, VSC-OTS keeps maximum LSZ value lower or equal to its initial value, whereas important cost reductions are still achieved. Indeed These results show that it is possible to open many lines successively without reducing loadability of the network, while obtaining relatively good cost reduction. Thus, the tendency of OTS to fragilize the network when many lines are opened comes from the choice of lines to open and not from any systematic relation between opening lines and loadability decrease, as intuition suggests. The existence of a certain number of topologies that do not fragilize the network is the reason why a set of constraints on loadability is possible.

A. NEEDS FOR A DIFFERENT CRITERION
When there is no congestion on a network, a full AC formulation will provide only slight benefits by identifying topologies that relocates losses to areas where the production is cheaper. This does not prevent total losses to be increased even if total costs are reduced.
The poor performances of OTS when there is no congestion are explained by the minimization criterion, which is based on power generation costs only. In fact, topological changes could be effective in controlling other important variables such total losses or loadability, which are two possibilities that have not been explored in literature.
Using such criteria could also allow OTS to be used in the hydroelectric context, where hydrology is responsible for the distribution of power production instead of costs.
The proposed criterion is where Coefficients λ 1 , λ 2 , and λ 3 are scalar weights to control relative importance of each terms of the criterion. Using (1,0,0) as values for λ 1 , λ 2 , and λ 3 gives the cost criterion usually used with OTS. When nonzero weights are used to create a multi-objective criterion, care must be taken in choosing their value. A good practice is to run an ACOPF on the nominal (full) topology, then compute the initial value of the three terms and adjust λ 1 , λ 2 , and λ 3 to obtain the needed relative importance. Term f 1 (X ) is the usual cost-based criterion where c P contains production cost of each generator in $/MW, whereas P g contains their production in MW. It should be noted that terms (3) and (4) are not equivalent even though they imply the same variable. In term (3), a cost is associated with each production. Thus, the objective is to distribute the production where it is cheaper. In some case, concentrate the production in a cheaper area may increase total losses. In the case of the term (4), the goal is to minimize the total production regardless of their individual cost. This is equivalent to minimize the total losses. This may increase the total costs. It should also be noted that (5) minimizes the squared sum of all LSZ values, which will cause the network to globally increase the voltage stability margins. However, this does not guarantee that every line will have a lower LSZ than the initial maximum value. For that reason, a good practice is to use criterion (2) or (5) in addition to a constraint on maximum LSZ value. Subscript f and t denote the ''from'' and the ''to'' ends of a line. Table 2 shows results of executing VSC-OTS on the 118-bus test case with its initial load (100%) when (4) is used as minimization criteria. Before opening any line (iteration 0), losses are minimized with an OPF, which gives total losses of 150.3MW. After the first opening, total losses decreased to 85.4MW and reached 82,9MW after 12 openings, which clearly shows that topological changes may lead to better results than a simple OPF.

B. USING VSC-OTS TO MINIMIZE NETWORK LOSSES
Results also show that minimizing losses tends to increase the operating costs. Indeed, in Table 1, the nominal topology (ranked 70 th for the 100% load), after costs minimization with an OPF, led to total costs of 1273.66$/h. The same topology in Table 2, after losses minimization with an OPF, led to total costs of 1431.89$/h. After the first opening, the costs increased to 3878.22$/h. Thus, reducing losses seem to imply an increase of costs and vice versa.
One reason that may explain the latter observation is that active losses are proportional to the squared magnitude of the current on a line. As OTS is looking for a maximum usage of cheaper generators, it increases transits close to them, thus increasing currents and consequently losses of nearby lines.
Finally, Table 2 shows that no topological change were able to decrease losses after minimization with an OPF for the 110% load. This result is important as it shows one limitation of the OTS when its control vector is limited to the state of lines. Extension to reactive devices will help to get around this problem.

C. USING VSC-OTS TO MAXIMIZE LOADABILITY
Results when VSC-OTS is used on the IEEE-118 bus test case with voltage stability margins as optimization criterion (5) are shown in Table 3. Minimization of the worst LSZ value for the network with an OPF on the initial topology gives a maximum LSZ of 0.293 for the normally loaded case (100%) and a value of 0.432 for the heavily loaded case (110%). In both load scenarios, VSC-OTS finds topologies that improve network stability. After 5 openings, the maximum LSZ value of the normal load scenario decreased slightly to 0.267 whereas it decreased more seriously at 0.294 after 6 openings in the heavy load scenario.
As in the case of losses reduction, it seems that a decrease in worst LSZ value implies an increase in production costs.
Inspection of (1) shows that a lower LSZ is obtained by decreasing the transit of a line. Consequently, as VSC-OTS minimizes and limits the maximum LSZ value for a network, it reduces transit on many lines, thus distributing the production across the network, including in expensive zones.
It is the first time that an OTS is used to minimize a voltage stability index. Results show that transmission switching may leads to better results than a simple OPF. Thus, OTS may be appropriate in a hydroelectric context, where production costs are not the decisive variable for operation planning. It also means that when there is no congestion on a network, OTS could be used to maximize network loadability.

IV. ADDING REACTIVE DEVICE CONTROL
Equation (1) shows that the stability of a line depends on voltage and reactive power. Reactive devices like shunt and series compensations or variable transformers (magnitude or phase) has an impact on the network's voltage profile and on reactive transits. Consequently, integrating controllable reactive devices in the control vector of the OTS formulation should lead to more flexibility by adding many potential topologies for a given situation.

A. LINE REPRESENTATION
The line representation in the E-OTS algorithm is shown in Fig.3. It is the same than in the OPF problem of [20], [22] except that line breakers are added at both ends of the line, transformer ratio is variable, and that it is possible to modify the reactance of the line by controlling the status of a compensation. Binary variables b l,k and b e,k represent the line breaker and series compensation status respectively. The transformer complex off-nominal ratio is given by where n r,k and n a,k are integers representing the tap position for magnitude and phase shift respectively. Thus, m k and a k are the magnitude and phase of the complex ratio r k From Fig.3, the resulting line impedance is given bŷ Which reduces tô where c e,k is the degree of compensation of line k, usually in the range 0.5-0.7, and b e,k is the binary status of the compensation. The resulting line admittance is given by the inverse of its impedance and is notedŷ 2,k . Branch k admittance Y l,k is given by the following 2 × 2 matrix The operator • is the elementwise multiplication.

B. NETWORK MODELLING
To obtain the network admittance matrix, the following vectors must be created where square brackets [·] denotes the diagonalization operator, and We then apply the same approach to other terms of Y l matrices where Finally, the network admittance matrix Y bus is given by Vector Y sh contains all shunt compensations of the network, and B h is the binary vector associated with shunt compensations status: where nb is the number of buses of the network. Thus, every bus has a shunt compensation status. When there is no shunt associated with a bus, its corresponding status is fixed to zero.
In the OPF problem of [20], [22] and in all previous and Y bus ) are constant, whereas in the proposed E-OTS problem, they are function of (12) and (23). These new degrees of freedom allow to modify line admittances (including setting them to zero). Thus, adjustments in currents, power flows, and line power factors are possible by changing the state or the value of controllable devices, giving more flexibility to the algorithm to find the best topology to minimize the selected criterion and to ensure loadability.
Because the effect of line opening is encapsulated in admittance matrix, it does not impose any value on voltage at both ends of the line. Thus, there is no need to use the ''big M value'' strategy to freed end voltages or to relax power flow constraints when lines are opened as in previous OTS [6], [15].

C. VOLTAGES, CURRENTS AND POWERS
All topological changes have been encapsulated in the network admittance matrix, thus currents and power flows vectors are given by the same equations than in [22] Vectors V , , and E θ contain the voltage modules, the phase angles, and the complex voltage phases respectively: To obtain voltages at the ''from'' (sending) and ''to'' (receiving) ends of lines, connection matrices C f and C t , that contain ''1'' on position (k,i) if bus i is connected to line k, must be used. Resulting vectors are

D. VECTOR OF UNKNOWNS
The goal of the E-OTS, as it is an optimization problem, is to find the value of unknown variables that minimizes a criterion while being subject to limits and constraints. Unknowns are of two types, network states and control values. The network states consist in bus voltage phases and magnitudes and V respectively. The control values are the active and reactive powers produced by generators P g and Q g , along with the targeted status of controllable (or candidate) lines, shunt & series compensations, and magnitude & phase taps of variable VOLUME 8, 2020 transformers, represented by column vectors U l , U h , U e , U m , and U a respectively.
There is an important difference between control vectors (denoted U ) and status vectors (denoted B and N ). U vectors contain optimization output values corresponding to statuses that network elements should get to minimize costs, whereas B and N vectors are inputs that correspond to current or initial status of the network elements. Another difference between both vectors is that status vectors contain a value for all elements of the network, whereas control vectors contain value only for candidate elements, i.e. devices that are considered as controllable by the algorithm. Status vectors (B and N ) are updated each iteration to reflect new statuses.
The complete E-OTS vector of unknowns, X , is defined as follow

E. EXTENDED OTS FORMULATION
The E-OTS formulation is given by P bus + P d − C g P g = 0 (47) Indeed, losses imply that the transit at the ''from'' end of a line is not the same than the one at the ''to'' end. Constraint (51) limits the number of changes from the initial topology to a selected value J . More precisely, L,H , E, M , and A are defined as follow The fact that each term of (51) is squared allows E-OTS to be compatible with initial topologies that are not nominal. Indeed, constraint (51) limits the number of topological changes, which can be either open-close or close-open transitions. OTS usually use a limit on total number of opened lines [6], [15], which is consistent only if it is assumed that an algorithm is limited to open lines that are initially closed, not the opposite. Finally, constraints (52) and (53) ensure that proposed topologies will not fragilize the network by reducing its loadability. Many variants of vectors max can be used depending of the desired effect on the static voltage stability. The following definition is used in this paper That is, the LSZ vectors are computed for the initial topology ( ft0 and tf 0 ). Then, the maximum value of LSZ (60) is used as the limit for every line. Consequently, E-OTS will only provide solutions that keep or improve the loadability of the network while respecting all other constraints. Finally, the minimization criterion used in E-OTS is given by (2).
Many variants of OTS can be obtained with the proposed E-OTS formulation. Indeed, by keeping only line candidates (empty U h , U e , U m , and U a ), and by deactivating constraints (52) and (53), a standard OTS (full AC) formulation equivalent to [15] is obtained. If line candidates are also discarded (empty U l ), we get an OPF problem (NLP) similar to Matpower [20], [22].

V. PERFORMANCES OF E-OTS (MINLP)
The proposed formulation of E-OTS (37-53) have been implemented in Matlab with Knitro as MINLP solver [23]. Analytical gradient and hessian of the Lagrangian have also been programmed, but their details are out of this paper's scope.

A. NETWORK ASSUMPTIONS
In order to use E-OTS, candidates for each type of devices must be selected. The IEEE 118-bus system has 186 lines, 14 shunt banks, and 9 transformers with off-nominal ratio. Matpower case files or usual IEEE common data format [24] do not provide information on series compensations. Thus, some assumptions must be made concerning candidates. In the case of lines, 11 of them are radial lines (12,15,20,116,124,146,149,151,152,184,185) and are discarded from candidate list. All 14 shunt banks are considered as controllable (buses 5, 34, 37, 44, 45, 46, 48, 74, 79, 82, 83,  105, 107, 110), and all 9 initially off-nominal transformers are considered as candidates (lines 13, 42, 49, 62, 107, 109,  111, 114, 140). It is considered that each transformer has 3 tap positions, giving ratios of 0.9, 1, or 1.  Table 4 shows proposed topological changes by E-OTS when used with usual costs criterion. In the 100% load case, costs were reduced to 1048.10$/h after 7 changes. In the case of VSC-OTS (Fig. 1), costs were reduced to 1042.02$/h, but after 15 changes. After 7 changes, VSC-OTS costs were at 1059.45$/h.
In the 110% load case, E-OTS gives better results than VSC-OTS. Indeed, after 13 topological changes, final costs decreased to 1274.77$/h comparatively to 1406.16$/h after 14 changes for the VSC-OTS (Fig.2).
The new degrees of freedom add many potential topologies for a given situation, which allow better results.

C. MINIMIZING LOSSES WITH E-OTS (MINLP)
As Table 5 shows, E-OTS has been able to reduce losses to 108MW in the 110% load scenario. No solution had been found with VSC-OTS (see Table 2 ). This confirms that taking reactive devices into account in the problem formulation may lead to solutions where there were none when only line status was considered. Thus, using E-OTS instead of OTS or VSC-OTS is appropriate.
Series compensation of lines 69 and 68 have been activated at iterations 1 and 2, and have been deactivated at iterations 3 and 4, bringing the network back to its initial topology, but with lower losses. This simply means that initial OPF has identified a local minimum for the nominal topology, and E-OTS has found a better one for the same topology. This also shows the ability of E-OTS to deactivate previously activated candidates or vice-versa. This is possible because of constraint 51, which is different than the one used in the literature to limit the number of opened lines.
In the case of nominal (100%) load, E-OTS leads to similar results than VSC-OTS (82.9MW for VSC-OTS and 82.6MW for E-OTS) but proposes a completely different sequence of actions. Table 6 shows results of E-OTS when the objective is to maximize voltage stability margins. One thing to note is that most of the proposed changes for both loads consist in series compensation activation. It is consistent with the fact that reactive devices have a bigger influence on LSZ value than line state because of their ability to change voltage of buses.

D. MAXIMIZING LOADABILITY WITH E-OTS (MINLP)
In both load scenarios, E-OTS led to better results than VSC-OTS. For the nominal (100%) load, E-OTS led to a worst LSZ value of 0.251 comparatively to 0.270 for VSC-OTS. For the heavy load, the worst LSZ value decreased to 0.279 with E-OTS instead of 0.297 with VSC-OTS. Algorithm have been stopped after 15 iterations because improvements had become negligible.

E. RELEVANCE OF E-OTS
Results show that E-OTS may lead to similar or better results than VSC-OTS for all considered criteria. In some cases, E-OTS may even lead to solution where there were none with other OTS, which constitutes an important improvement and one of the main contributions of this paper. VOLUME 8, 2020 However, leading to good results is not enough to make E-OTS a success. Indeed, the proposed algorithm has an important issue with resolution time. In Tables 1 to 6, resolution times vary between 709 and 17 406 seconds (0.2 to 4.9 hrs), which is prohibitive for a small network like the IEEE-118 bus test case. If E-OTS is to be integrated in EMS as an operation planning tool (in the near real-time zone), resolution time must stay below 40 minutes for a given network. This would give time to test the proposed topology with EMS dynamic security tools and lead to one topological proposition based on the network's situation each hour.
Also, to be relevant, E-OTS must reach this resolution time objective for larger networks. It should be able to propose a solution in less than 40 minutes for networks with 1000 to 2000 buses. Thus, developing heuristics is a necessity.

VI. DECREASING RESOLUTION TIME A. PARALLEL OPF APPROACH
One easy way to reduce resolution time consists in testing every potential topology by changing the state or the tap position of each candidate (lines, compensations, transformers) with an OPF. As each OPF is an independent problem, it becomes possible to parallelize their resolution. Thus, resolution time depends on the number of available CPU cores. The main advantage of this approach is that the very best solution is always found as every possibility is tested. For this reason, we do not consider this approach as heuristic.
Using this approach on the PEGASE network [25] (1354 buses, 1991 lines) of the Matpower library [20], [25], a total of 3375 candidates must be tested to simulate the E-OTS algorithm (with J = 1). With a 28 cores computer, it takes 9413 seconds (2h36) to identify the best topological change to apply on the network, which is not fast enough. However, if a 112 cores computer was used, this exact approach could be used for this network in less than the limit of 40 minutes.
For the Polish winter peak network (2383 buses, 2896 lines) of the Matpower library, a total of 3096 candidates must be tested with OPF, which takes 12 906 seconds (3h35) with the previously mentioned 28 cores system. In that case, a computer with 192 cores would be needed to respect the time constraint of 40 minutes (2400 seconds) with the parallel OPF approach.
Business cases must be conducted to determine if investment in such computers may be appropriate.

B. PROBLEM SPACE REDUCTION WITH POWER FLOWS (H1)
The first proposed heuristic (H1) consists in analyzing each candidate's influence on the criterion with power flows (PF), then select only the most influents, and test the resulting group of candidates with the parallel OPF approach. Candidates influence on criterion may not be derived analytically because the criteria (2)(3)(4)(5) are not function of states or tap position (Û l ,Û h ,Û e ,Û m ,Û a ).
A simple power flow (PF) finds the transits of the network for a given situation. It does not minimize any criterion; thus, it does not change the power generation. Consequently, it is much faster than OPF. In the case where the objective is to reduce losses or increase voltage stability margins, PF allows to fast identify individual influence. However, PF analysis cannot be used to assess individual influence of candidates on costs because it assumes fixed generation. Thus, this first proposed heuristic (H1) may not be used for cost minimization but is well suited for the hydroelectric context.
After the PF analysis, only the most influent candidates are considered as ''potential''. To be considered influent enough, a candidate must have an impact on the criterion greater than a certain threshold | f (X )| ≥ t, which is the unique parameter of the heuristic. A low value of t will consider more candidate as ''potential'', which increase the probability of having identified the very best topological change but will take more time to test retained candidates with parallel OPF approach. Conversely, a high value of t will retain less candidates, which will accelerate the parallel OPF step, but will reduce the probability of having identified the best candidates. Thus, the threshold value must be chosen to minimize time but ensure that very good candidates are identified.

C. PROBLEM SPACE REDUCTION WITH RELAXED E-OTS (H2)
The second proposed heuristic (H2) may be used with any criterion, unlike H1 that may not be used with costs criterion. It is in fact an adaptation of the proposed heuristic in [15]. It consists in using a relaxed (NLP) version of E-OTS to determine the relaxed value of the state or tap position of every candidate. Then, only the candidates with the most changed value are kept as ''potential'' for the next step, which is also an execution of the parallel OPF approach.
The parameters of H2 are defined as follow: Low value of parameters will submit more candidates to the next step, which will increase probability of identifying very good candidates but will also increase resolution time.
A compromise between resolution time and the number of considered candidates must be determined.  Table 7 shows results for both heuristics and all criteria for the 1354 bus system. The threshold t used for each case is shown in column 2. In the case of H2, all the parameters (61-65) have been set to the same value. The proposed action (topological change) is shown along with its ranking and the obtained criterion value. The best topological change (obtained by testing every possibility with the parallel OPF approach) is also shown with the best value for the given criterion. Finally, the resolution time of the heuristic is displayed in the last column.

VII. RESULTS ON LARGE NETWORKS
When the objective is to minimize losses, the first heuristic (H1) identifies the best topological change to apply on the network in 2011 seconds, i.e. opening line 298 to reduce losses from an initial value of 1882.6MW to 1685.0MW. Heuristic H2 identifies the 18 th best topological changes in 1041 seconds, which is not bad considering a total of 3375 possible topologies. It proposes to activate the series compensation of line 863, which brings losses to 1809.9MW.
For comparison, the test of all possible topologies with parallel OPF approach took 9413 seconds, thus, both heuristics have accelerated the resolution of the problem.
It is possible that a different value of the parameter t could allow H2 to identify better candidates at the expense of resolution time.
When the objective is to maximize the loadability, heuristic H1 identifies the best topological change in 419 seconds, bringing the worst network LSZ value from 0.557 to 0.446, whereas H2 proposes the 4 th best change, which brings the worst LSZ to 0.515.  Finally, when the objective is to minimize the production costs of the network, H2 proposes to change the ratio of the transformer on line 1792 from 0.9362 to 1, which is the best possible change. The heuristic takes 708 seconds to solve the problem. In this case, there was no congestion on the network, so minimizing of the costs consists in relocating losses in cheaper area instead of increasing the use of cheaper generator by eliminating congestion on nearby lines. That explains why the topological changes have a limited impact on costs (from an initial value of 74 069.35$/h to a final value of 74 059.29$/h in the best case). Results show that OTS is still efficient in minimizing losses or maximizing loadability when there is no congestion on the network.  Table 8 shows results for both heuristics and all criteria on the 2383 bus system. In the case of losses minimization, initial losses are of 497.5MW and the best topological change to apply on the network implies final losses of 488.3MW, which is not a great decrease. Testing every possibility with parallel OPF approach took 12 906 seconds. Heuristic H1 identifies the 26 th best candidate on a total of 3096 possibilities in 2109 seconds. That brings the losses to 495.6MW. Heuristic H2 does better by proposing the 13 th best topology in 2332 seconds, near the constraint of 2400 seconds (40 minutes), which decreases losses to 493.4MW. Such a decrease may seem small, but if we consider a rate of 20$/MWh, a mean decrease of 4MW during a year represents a total of 700.8k$. Thus, the small improvements given by the heuristics are still substantial.
In the case of maximizing voltage stability margins, initial worst LSZ value is at 0.495 and the best action to apply on the network decreases it to 0.367. Heuristic H1 proposes the second-best option in 733 seconds, which gives a worst LSZ of 0.375, whereas H2 identifies the 9 th best option in 749 seconds, which gives 0.409.
The proposed parameter values could be optimized to use more time and test more candidates, thus lead to better results. However, it is clear from the results that both heuristics can reduce resolution time and still give relatively good results in improving network's condition. Moreover, both heuristics are scalable. Using more CPU cores could lead to better results on similar size networks or could allow similar results on bigger networks.

VIII. CONCLUSION
This paper proposed many improvements to the OTS. It first showed that OTS tends to fragilize the network, but more importantly it showed that many alternative topologies that reduce costs and keep or improve initial loadability exist, which is a counter-intuitive, but important result as it allows the use of constraints on loadability. The latter observation led to a new formulation, the VSC-OTS, that keeps or improves initial voltage stability margins when opening lines.
This paper also proposed a generalized objective function. It showed that OTS may be effective in reducing losses or maximizing loadability, which allows OTS to be used in a hydroelectric context, where hydrology dictates the power generation instead of unit costs.
The capacity of OTS to outperform OPF with such objective functions had never been explored.
Also, this paper showed that to take advantage of the real network's flexibility, compensations status and transformers tap position must be added to the control vector. This led to a new formulation, the E-OTS (extended OTS) that includes all previously proposed improvements in addition to the new degrees of freedom. Results show that E-OTS can identify solutions where there were none with previous OTS or improve results where there were solutions. Unlike other algorithms, E-OTS is suitable for less dense or mostly radial networks. However, resolution times of the MINLP implementation of the proposed algorithm are prohibitive.
To avoid the latter problem, two heuristics were proposed. The first one uses power flows to assess candidates individual influence on the minimization criterion. Results show this novel approach allows the E-OTS to propose beneficial topological changes in less than 40 minutes for large networks (2383 buses and 3896 lines). However, it cannot be used with the production costs criterion. The second heuristic, based on relaxations of E-OTS, may be used with any criterion. Both proposed heuristics are scalable i.e. that more CPU cores may be used to improve results or to increase the maximum network's size for which they propose changes in less than 40 minutes. The next step is the development of an interface between an EMS and Matlab that would translate current state of a real network into inputs to the proposed E-OTS. The proposed topological change will then be sent to the EMS dynamic security application for transient stability assessment.
Adding more degrees of freedom such as bus splitting [26] to the algorithm is also considered as future work.