Algorithm 3.

Main algorithm: Simultaneous optimization (Reconfiguration-Placement)

Step 1: Initialize the first iteration t = 1

Initialize pheromones: τ i j τ 0 i , j = 1 , , n

Initialize position p

Step 2: For each ant k = 1 to m

Build a cycle T k ( t ) of tie-switches

Update tie-switches

Step 3: Look for a single path from a given node to the source node with excluded open switches

Step 4: Rearrange loads from end-of-branch nodes—save new topology

Step 5: For each ant k = 1 to m

Evaluate the radiality criterion of the new configuration

If the configuration is radial

Exclude the current topology—Goto Step 6

else

Find p position in the current cycle

Evaluate size of the D-STATCOM at the position found and the power flow of network with the D-STATCOM placed at the position found

Step 6: Compute cost function L k ( t ) of T k ( t )

Update the best global solution

Step 7: For each arc ( i , j )

Update pheromones τ i j while confining them in [ τ min , τ max ]

t = t + 1

if t < N C max

Goto Step 2

else

Stop

Return the best global solution