Version for STSP ALGORITHM CHEAPEST INSERTION. Choose the two furthest vertices i and k as initial subtour (c ik = max {c hj : (h, j) A}); set V := V \ {i} \ {k} (set of the unvisited vertices).. For each unvisited vertex j (j V ) determine the best insertion of j in the current subtour (i. e., determine the arc (i j, h j ) of the current subtour such that e j := c ij,j + c j,h j c ij,h j is minimum): i. Determine the unvisited vertex k (k V ) such that e k is minimum (e k = min {e j : j V }); insert vertex k between vertices i k and h k ; V := V \ {k}. If V then return to STEP. Else STOP. j h j j
ALGORITHM CHEAPEST INSERTION () v Time complexity: O(n ). v Good results if the triangle inequality holds. * Version for ATSP? * Is Cheapest Insertion a greedy algorithm?
Example Algorithm Cheapest Insertion Opt = Solution cost: (optimal) (, ) (,, ) (,,, ) (,,,, ) (,,,,, )
Example Opt = Algorithm Cheapest Insertion (, ) (,, ) (,,, ) (,,,, ) (,,,,, ) Solution cost:
GREEDY ALGORITHM MULTI-PATH (Bentley, 0) Version for STSP. Order the arcs of the graph according to non-decreasing values of the associated costs (c ij ).. If the insertion of the next arc (i, j) into the current solution (given by a family of paths) is feasible, i.e. the current degrees of vertices i and j are and arc (i, j) forms no subtour (i. e. there is no path from j to i whose number of arcs is less than n - ), then select arc (i, j).. If the number of the selected arcs is less than n then return to STEP. Else STOP. v v Time RANDOMIZED complexity: VARIANT O(n log n ) (the algorithm is similar to the Kruskal At algorithm STEP, for consider the Shortest the next Spanning feasible Tree) arcs: select the next arc with probability /, select the following arc with probability /.
Example Opt = Algorithm Multi-Path Solution cost: (optimal) Ordered arcs: (, ) (, ) (, ) (, ) (, ) (, ) (, ) (, ) (, ) (, ) OK OK OK NO OK NO NO OK OK STOP
Example Opt = Algorithm Multi-Path Solution cost: Ordered arcs: (, ) (, ) (, ) (, ) (, ) (, ) (, ) (, ) (, ) (, ) (, ) (, ) OK OK NO NO OK OK NO NO NO OK NO OK STOP
ALGORITHM SAVINGS (Clark-Wright, ; VRP) (version for STSP, good results if the triangle inequality holds) v v Choose any vertex k as the depot. Set V := V \ {k}. For each arc (i, j) A such that i V and j V compute the score ( saving ): s ij := c ik + c kj - c ij i j i j k k saving corresponding to the direct connection of vertex i with vertex j bypassing the depot k. s ij := (c ki + c ik + c kj + c jk ) (c ki + c ij + c jk )
ALGORITHM SAVINGS. For each vertex i V define the subtour (k, i, k); order the arcs (i, j) A (with i V, j V ) according to non-increasing values of the corresponding savings s ij.. If the insertion of the next arc (i, j) into the current solution (given by a family of subtours passing through k) is feasible, i.e. the current degrees (w.r.t. vertices belonging to V ) of vertices i and j are and arc (i, j) forms no subtour containing only vertices belonging to V, then remove arcs (i, k) and (k, j) and insert arc (i, j).. If the number of the inserted arcs is less than n then return to STEP. Else STOP. v Time complexity: O(n log n ) v Version for ATSP?
Example Algorithm Savings Opt = depot k =. Savings: S, = S, = S, = S, = S, = 0 S, = 0 S, = S, = S, = 0 S, = 0 Ordered arcs (, ) (, ) (, ) (, ) (, ) (, ) (, ) (, ) (, ) (, ) 0
Example Algorithm Savings () Opt = k =. Ordered arcs: depot (, ) (, ) (, ) (, ) (, ) (, ) (, ) (, ) (, ) (, ) OK OK OK NO OK NO NO OK OK STOP
Example Algorithm Savings () Opt = k =. Selected arcs: depot (, ) (, ) (, ) (, ) (, ) (, ) Solution cost: Complete the tour with arcs (, ) and (, )
LOCAL SEARCH ALGORITHMS v Sequence of feasible exchanges of r arcs belonging to the current tour with r arcs not belonging to the current tour (an exchange is feasible iff it leads to a new tour). v If a feasible exchange reduces the global cost of the tour then the exchange is performed. v Two versions:. update the current tour as soon as an improving exchange is found;. determine the best exchange (corresponding to the maximum improvement) and perform it. v r-optimal algorithms (Lin, ).
STSP v r = (-optimal exchange) i k i k l j l j v Time complexity O(n ) (for each iteration). v Cost variation = (c ij + c kl ) - (c ik + c jl ) v For each exchange: time complexity O(k)
Example (-optimal exchange) Initial solution found by algorithm Nearest Neighbour with Initial Vertex = with arcs (, ) and (, ) (cost = 0) Exchange arcs (, ) and (, ) (cost = ) Initial cost = Final cost =
ATSP v r = (-optimal exchange) i k b i k b l j a l j a v Cost variation: (c ij + c ja + + c bk + c kl ) - (c ik + c kb + + c aj + c jl ) v Both directions can be considered: clockwise, anti clockwise.
STSP v r = (-optimal exchange) i k j i k j n m n m l l v Time complexity O(n ) (for each iteration). v Cost variation = (c ij + c kl + c mn ) - (c ik + c jm + c ln ) time complexity O(k)
Example (-optimal exchange) Initial solution found by algorithm Cheapest Insertion Initial cost = Final cost = Exchange arcs (, ), (, ) and (, ) (cost = ) with arcs (, ), (, ) and (, ) (cost = )
STSP v r = (-optimal exchange) : by removing arcs from the current tour, different feasible tours can be obtained: v v v v v v v v z z z z u u z u u z u u z u u z (a) (b) (c) (d) v v v v v v v v z z z z u u z u u z u u z u u z (e) (f) (g) (h)
ATSP v r = (-optimal exchange) : different feasible tours (both directions can be considered) v v v v v v v v z z z z u u z u z u z u u u u z (a) (b) (c) (d) v v v v v v v v z z z z u z u z u z u (e) (f) (g) (h) z 0
COMPUTATIONAL RESULTS Symmetric TSP (undirected graphs). Two classes of randomly generated instances (n is given): ) Random Euclidean instances For each vertex i (i =,, n): generate a random point (x i, y i ) in a square 00 x 00: x i := uniform random value in (0, 00), y i := uniform random value in (0, 00). For each vertex pair (i, j) (i =,, n; j =,, n): c ij := (x i - x j ) + (y i - y j ) (symmetric cost matrix, the triangle inequality holds)
COMPUTATIONAL RESULTS FOR STSP ) Random Distance instances For each vertex pair (i, j) (i =,, n-; j = i+,, n) c ij := uniform random number in (, 00); c ji := c ij (symmetric cost matrix, the triangle inequality does not hold) v n = 00, 000, 0000, 00000. v 0 instances for each class and for each value of n. v Percentage gap between the solution cost found by the heuristic algorithm and the Lower Bound proposed by Held- Karp 0 (-SST Relaxation with subgradient optimization procedure). v CPU times in seconds of a 0 MHz SGI Challenge.
STSP - RANDOM EUCLIDEAN INSTANCES Algorithm n = 0 n = 0 n = 0 n = 0 N. Neighbour. (0.00).0 (0.0). (0.). () Multi-Path. (0.00).0 (0.0). (.). () Savings. (0.00). (0.). (.). () -Opt. (0.0). (.0).0 (.). () -Opt. (0.0). (.).0 (.).0 () % gap (CPU times in seconds) procedures -opt and -opt with initial solution found by the Randomized Multi-Path algorithm
STSP RANDOM DISTANCE INSTANCES Algorithm n = 0 n = 0 n = 0 N. Neighbour 0 (0.0) 0 (0.) 0 () Multi-Path 00 (0.0) 0 (0.) 0 (0) Savings 0 (0.0) 0 (.) 00 () -Opt (0.0) 0 (.) () -Opt 0 (0.0) (.) () % gap (CPU times in seconds) procedures -opt and -opt with initial solution found by the Randomized Multi-Path algorithm
HEURISTIC ALGORITHMS FOR THE ATSP (in addition to the modifications of the previously described algorithms) ALGORITHM PATCH (Karp-Steele, ). Solve the Assignment Problem (AP) corresponding to the cost matrix (c ij ).. If the current AP solution is a tour then STOP.. Consider the subtour S having the maximum number of vertices. Expand S by combining ( patching ) it, through a arc exchange, with a different subtour S so as to minimize the variation of the global cost of the two subtours S and S. Return to STEP.
Example: Given subtour S and a different subtour S (for all subtours S ) i l S S j k exchange arcs (i, j) and (k, l) with arcs (i, l) and (k, j) so as to minimize: (c il + c kj ) - (c ij + c kl ) with respect to all the possible arc exchanges between subtours S and S
Example A Opt = Final cost = (optimal solution) AP solution = (Lower Bound) Patch the two subtours by exchanging arcs (, ) and (, ) with arcs (, ) and (, )
v Variant of Algorithm Patch v ALGORITHM CONTRACT OR PATCH (Glover-Gutin-Yeo-Zverovich, 00) After STEP ( if the current AP solution is a tour then STOP ) add the steps: a. if the current solution contains at least a subtour R with less than t vertices then: remove the maximum cost arc (h, k) of R and contract the resulting path (from k to h) into a single supervertex r. R h k r c hj c ik j i solve the AP corresponding to the current graph, and return to STEP a. b. re-expand, in a recursive way, the supervertices so as to obtain an AP solution corresponding to the original graph.
ALGORITHM TRUNCATED BRANCH-AND-BOUND v Modification of the branch-and-bound algorithm based on the AP relaxation and the subtour elimination branching scheme. v At each level of the branching tree: consider only the descendent node corresponding to the minimum value of the associated Lower Bound (cost of the corresponding AP relaxation), by removing all the other descendent nodes.
ALGORITHM TRUNCATED BRANCH-AND-BOUND () AP solution level level arc (, ) imposed X, =... V(AP(k))= X, = 0 X, = 0 X, = 0 X, = X, = k X, = 0, X, = X, = X, = X, =... k k k k V(AP(k))= v(ap(k)= v(ap(k))= v(ap(k))= V(AP(k,))= k, k, k, v(ap(k,)= v(ap(k,))= 0... 0
COMPUTATIONAL RESULTS FOR ATSP classes of randomly generated instances. different values of n: 00,, 000, 0 instances for n = 00, ( for n = 000, for n = ) HK = Held-Karp lower bound corresponding to the -Shortest Spanning Arborescence Relaxation with Subgradient Optimization procedure. -OPT with starting solution found by the Nearest Neighbour Algorithm CPU times in seconds of a 0 MHz SGI Challenge Percent above HK MULTI - PATH Time in Seconds Class 00 000 00 000 tmat..0...0.. 0 amat.0....0.. shop..0...0.. 0 disk. 0....0.. super.0.0...0.. crane..0.0.0.0.. coin.....0.. 0 stilt 0.....0.. rtilt 0. 0. 0. 0..0..0
NEAREST NEIGHBOUR Percent above HK Time in Seconds Class 00 000 00 000 tmat.0.0...0.. 0 amat....0.0.. shop.....0.. 0 disk. 0....0.. super... 0..0.. crane 0.....0.. coin.0..0.0.0.. 0 stilt 0. 0....0.0. rtilt....0.0.. - OPT Percent above HK Time in Seconds Class 00 000 00 000 tmat....0... 0 amat....0... shop.0. 0. 0.... disk.. 0..... super..0.0.... crane.. 0. 0.... coin.0...... 0 stilt......0. rtilt 0.0.0.00...0.
PATCH Percent above HK Time in Seconds Class 00 000 00 000 tmat....00.0.. amat 0..0...0.. shop.....0.. 0 disk.0...0.0.. super.....0.. crane.0 0....0.. coin....0.0.. stilt.....0.. rtilt.0....0.. CONTRACT OR PATCH Percent above HK Time in Seconds Class 00 000 00 000 tmat....00.0.. amat....0.0.. shop....0.0.. disk.00....0.. super.0.0..0.0.. crane 0..0...0.. coin....0.0.0. stilt...0.0.0.. 0 rtilt.. 0. 0..0..
TRUNCATED BRANCH AND BOUND Percent above HK Time in Seconds Class 00 000 00 000 tmat.0.0.00.00.0.. 0 amat...0.0.0.. shop.0.0.0.0.0.0. 0 disk...0.0.0.. 0 super.....0. 0. crane...0.0.0.. coin.0.0...0.. 0 stilt 0....... rtilt..0.....0