*5.3. Solution*

A four-step solution procedure was developed to solve the model defined in Equations (8)–(18). Step 1. Take one origin and destination (OD) pair (*vo*, *vt*) to be optimized. The Dijkstra shortest-path algorithm is used to search for the shortest route, *r*1. If *r*1 can meet the line length constraints, it will be used as the alterative line and then choose the next OD pair. Otherwise, go to Step 2.

Step 2. Search for *rk* after *rk*−1 is confirmed. Mark the node and as for any node, *vh* ∈ *Vo*. Its mark value is computed by Equation (19), where *Sk* is given in Equation (20)

$$P\_{\rm li} = \min\_{m=1...k-1, i \in V, j \in V\_{\rm f}} \left( L\_i + L\_{i\bar{j}} + S\_m - L\_{\bar{j}} \right) \tag{19}$$

$$S\_k = \min\_{h \in V\_\varepsilon} P\_h \tag{20}$$

If *Ph* = *Sk* and *rk* go through node *vh*, then refresh the mark of *vh*. If there is no adjacent point at this point, the mark is updated to infinity. *Vm* is the set of points through which the shortest path passes. *V* is the set of nodes on the shortest route. *Li* is the distance between node *i* and starting point *o*; *Lij* is the distance between neighbor nodes *i* and *j*; and *Sm* is the length of *m* shortest route.

Step 3. Check whether *rk* meets the line length constraints. If it does meet it, it can be chosen as the alternative route; otherwise go back to Step 2.

Step 4. Check if all the OD pairs are searched. If found, the alterative line set *R* is obtained; otherwise, go back to Step 1.
