Using Travelling Salesman Principle to Evaluate the Minimum Total Cost of the Iraqi Cities

Abstarct The traveling salesman problem (TSP) is a well-known and important combinatorial optimization problem. The goal is to ﬁnd the shortest tour that visits each city in a given list exactly once and then returns to the starting city. In this paper we exploit the TSP to evaluate the minimum total cost (distance or time) for Iraqi cities. So two main methods are investigated to solve this problem; these methods are; Dynamic Programming (DP) and Branch and Bound Technique (BABT). For the BABT, more than one lower and upper bounds are be derived to gain the best one. The results of BABT are completely identical to DP, with less time for number of cities (n), 5 ≤ n ≤ 25. These results proof the efficiency of BABT compared with some good heuristic methods. We are suggesting some additional techniques to improve the computation time of BABT for n ≤ 80.


Introduction
In the field of combinatorial optimization, the Traveling Salesman Problem (TSP) is probably the most famous and extensively studied problem, which aims to find the shortest Hamiltonian Cycle in a graph.This problem is NP-hard: that is to say, no polynomial time algorithm is known for solving this problem at present [1].The algorithms for solving the TSP can be categorized into two main paradigms: exact algorithms and heuristic algorithms.The exact algorithms are guaranteed to find the optimal solution in an exponential number of steps.The major limitation of these algorithms is that they are quite complex and have heavy requirement of computing time [1].For such reason, it is very difficult to find optimal solution for the TSP, especially for problems with a very large number of cities. Heuristic algorithms attempt to solve the Traveling Salesman Problem focusing on tour construction methods and tour improvement methods.Tour construction methods build up a solution step by step, while tour improvement methods start with an initial tour then try to transform it into a shortest tour [1].

TSP Background and Formulation
The first researcher, in 1932, considered the traveling salesman problem [2].Menger gives interesting ways of solving TSP.He lays bare the first approaches which were considered during the evolution of TSP solutions.An exposition on TSP history is available in [2].The mathematical formulation of TSP is as follows: The distance between the towns i and j is marked with d ij .x ij =0 or 1. [2].

𝑀𝑖𝑛𝑖𝑚𝑖𝑧𝑒
1, if city  is reached from city  0, otherewise C is the total cost of travel.

Some Exact Methods to Solve TSP 3.1 Dynamic Programming [3].
Dynamic programming (DP) is a method of solving problems by breaking the solution into a set of steps or stages so that the solution of the problem can be viewed from a series of interrelated decisions.The inventor and the person responsible for the popularity of DP is Richard Bellman.In DP, a series of optimal decisions are made by using the principle of optimality.The principle of optimality: if the optimal total solution, then the solution to the k th stage is also optimal.With the principle of optimality is guaranteed that at some stage of decision making is the right decision for the later stages.The essence of DP is to remove a small part of a problem at every step, and then solve the smaller problems and use the results of the settlement to remedy the solution is added back to the issue in the next step.The algorithm of the DP is as follows:

Dynamic Programming Algorithm [3]. Initialization steps  Complete directed graph (G).
 Non-empty finite set of vertices on a graph (V), V = {1, 2, 3, ... n}. The set of edges in a graph (E). The distance from i to j (the distance between cities) d ij , where d ij ≠ d ji . The series lines (S), S  {2, 3, ..., n}. The weight of the shortest path that starts at vertex i that through all vertices in S and ends at vertex 1 (f (i, S)), i S and S ≠ Ø. Therefore the steps in solving the TSP with DP are as follows: Step 1: Determining the basis of the graph Hamiltonian that has been represented to be an adjacency matrix to the equation: Step 2: Calculate f (i, S) for |S| = 1, then we can obtain f (i, S) for |S| = 2, until |S| = n-1.With the equation: Step 3: Having obtained the results from step 2, then calculate the equation of a recursive relationship by following equation: Step 4: After calculating a recursive equation in step 3, will be obtained by weighting the shortest path, then to obtain an optimal solution or length of the shortest path for a graph is to calculate f (1, {2, 3, 4, ..., n}) which means long lines from the initial vertex (1) to vertex 1 after passing through the vertices 2, 3, 4, .., n with any order (for the minimum) then locate the forming of the minimum optimal solution which has been obtained.

Branch and Bound Technique for Solving TSP
BAB technique (BABT) is most widely used in TSP by constructing a state space tree to find the optimal solution among all feasible solutions by taking the value of the objective function.Branch and bound was initially studies by Dantzig and a more description was provided by him in the applications of TSP.The BABT gives all feasible solutions by solving the problem, by trying the practical solution ad starting the value in the upper bound for finding the optimal solutions [4].The algorithm of the BABT is as follows:
Step 2: Choose one of the routes for that point.
Step 3: After choosing that route between the current point and unvisited point add the distance.After doing that choose a new destination without choosing the same point.
Step 4: Keep doing this until we have gone through each point.
Step 5: Add up each distance of each subgroup.

Some Heuristic Methods to Solve TSP [6].
In this section we will discuss two heuristic methods; Greedy method, Branch and Bound Method and Improved Minimum distance method.
The Greedy method (GRM) starts by sorting the edges by length, and always adding the shortest remaining available edge to the tour.The shortest edge is available if it is not yet added to the tour and if adding it would not create a 3-degree vertex or a cycle with edges less than n.This heuristics can be applied to run in O (n 2 log(n)) time.
The terms "Branch and Bound" represent all the state space search methods such that all the children of E-node are generated any now nodes called line node when it became E-node.E-node is the node, which can be expended.The live-node is node generated all of whose children are not yet been expanded.A node which cannot be expanded called dead node, but this node can be useful for backtracking concept.If there are no more children to expand then we have to reach its parent and expand its children and we do so until we obtain the solution or complete tree path, this method is different in technique from BABT mentioned in section .The Minimizing Distance Method (MDM) is an efficient method for finding a good solution, but it has a weak point.This weak point has been manipulated by improved minimum distance method (IMDM) which is suggested in [6].The IMDM has good achievement with high efficiency for solving TSP.

Using DP to Solve TSP
In this section the method of DP was applied to solve TSP.The obtained results were better than the method of Complete Enumeration Method (CEM) in terms of time and number of cities.
In this paper set of practical examples are be used with different choices for n such that 5≤n≤80 with integer distance such that d ij  [1,30] for 5≤n≤30 and d ij [1,100] for 30<n≤80.Before we discuss the results we have to define the following notations:  C: The cost of travel.
The difference between set of methods with first method in table.
Table 1.shows the comparison results between DP from one side with CEM and the best Heuristic method [6].IMDM from another side for n=5,…,15 for average of ( 3) examples.

Using BABT to Solve TSP
In this section we will discuss and the applying of BABT to solve TSP.It is very well known that BABT is one of the most important methods of the exact solution for combinatorial optimization problem.This method can act with different upper and lower bound to get very good results within a good time.The choosing process of upper bound (UB) and lower bound (LB) is figured as (UB-LB) this symbol of UB and LB we called it a model for BABT with notation BABT: (UB-LB).

Suggesting an Upper Bounds for TSP
In order to use BABT to solve TSP, we apply three methods for finding three different UB; and these methods are IMDM, GRM and BABM.

Derivation of Different Lower Bounds for TSP
The LB is one of the most important parts of this method.The LB consists of two main parts such that LB= Sequenced nodes plus the unsequenced nodes, the sequence nodes: is the basic rout until the currant node.While the unsequenced nodes: it's the subsequence obtained from all the cities after eliminate the sequence nodes which are obtained from applying deterministic method.Several methods have been proposed to calculate the LB; these methods are GRM, BABM and IMDM.But based on the results obtained from these methods it was concluded that the best method is the IMDM because it gives accurate results with reasonable time.

Two Proposed BAB Techniques
In this subsection we proposed two techniques for BAB, the first technique is the classical BABT with notation BABT1, which is mentioned in subsection 3.2.The BABT1 algorithm is as follows:
Step 3: For each node in the search tree compute the LB= cost of sequencing nodes + Cost of unsequenced nodes; where cost of unsequenced nodes is obtained by GRM, BABM or IMDM, i=i+1.
Step 4: Branch each node with LB ≤ UB for level i.
Step 5: If i  n then goto step 3.
Step 6: If the last level (i=n-2) of BAB algorithm we obtain the optimal solution.
Step To calculate UB, we use GRM so UB=58, for unsequnced nodes we use IMDM.
For the 2 nd level we have the following tree: The shaded node is ignored.
It's clear that we ignore N.1, while for the 3 rd level we obtain the following tree: So we ignore the nodes N.9, N.10 and N.11.In the last level we have the following tree: So the least cost C=37 with shaded path: ACEDBA.
The second technique is similar for BABT1 but with modification.This modification includes finding a LB by branch form the least cost node and continue until get the root node and calculate the LB, then we update the initial UB by the new LB, and then apply the same steps of BABT1.The BABT2 algorithm is as follows:

BABT2 Algorithm
Step 1: Read number of cities (n); Read Distance table.
Step 3: Compute the New_LB= cost of sequencing nodes + Cost of unsequenced nodes; where cost of unsequenced nodes is obtained by IMDM, if New_LB ≤ UB1 branch from this node and set UB1=New_LB, repeat until reach the root node set UB=UB1, if all New_LB  UB1 then UB=UB1.
Step 5: For each node in the search tree compute the LB is obtained by IMDM, i=i+1.
Step 6: Branch each node with LB ≤ UB for level i.
Step 7: If i  n then goto step 5.
Step 8: If the last level (i=n-2) of BAB algorithm we obtain the optimal solution.
All the above models have been tested and it has been shown that the best models (cost and time) in terms of results are GRM-IMDM, IMDM-IMDM and BABM-IMDM.

Results of Applying BABT1
Table 2 shows the comparison results of BABT1 for different models one side and with DP from the other side for n=5,…,15 for average of ( 3) examples.From the results of Table 2. we notice that all models are identical to DP but IMDM-IMDM is the best in the time.
Table 3. shows the comparison results of BABT1 for the three models with each other for n=16,…,20,25.

Results of Applying BABT2
For BABT2 we notice that all the results for the three models are identical with each other's in cost and time so we choose one of the models to describe and compare its results with others methods.Table 4. Shows the comparison results between BABT1: IMDM-IMDM (or DP since they are identical) and BABT2: GRM-IMDM model for n=5,…,20,25 for average of ( 3) examples.4.

Solving the Minimum Total Cost for the Iraqi's Cites as a TSP
In this section we will use the TSP as an application to compute the minimum total cost for n=18 Iraqi's cites.This done by applying the best method; the BABT1: (IMDM-IMDM) (see Table 4.The symbol of each city is as in Table 6.First we demonstrate the distance in km in Table 6.for the 18-cites which are represent the governorates centers [7].In the same time we have to estimate another cost which is represented by time factor by using distance cost mentioned in Table 6.In order to estimate the time cost we have to use the following transformation: T = D / V (4) Where T is the time, D is the distance and V is the velocity factors respectively.Table 8. describes the time cost in minutes depending on distance cost mentioned in Table 7. using constant velocity 70km/hour.Now we suggest to apply more than one method like DP, BABT1: IMDM-IMDM and BABT2: GRM-IMDM for distance cost in Table 6.and time cost in Table 7. for n=18.Before we describe the results we suggest using successive rules (SR's) to be certain that what we obtain is optimal path.These SR's is as follows: 1.Since the subpath Ms-Dh-Er is the only and the minimum cost of available path this mean that we have n=16.2. Let's add another certain subpath to the previous one, Am-Bs-Ns, this mean we have n=14.
Table 9. shows the results of the three suggested methods for n=18 (without SR) and for n=16 and 14 (with SR).For the above optimal costs we have the following unique symmetric path.Path is: "BgBqSlKrErDhMsTkRmKbHlNjDwSmNsBsAm KuBg" It's important to mentioned that we get better solution (for distance 2496 and for time 2140) than the obtained solutions mentioned above but the path doesn't satisfies the constraints of TSP. this mean we obtained the optimal solutions for the total costs of the Iraqis cities. Figure 3. shows the best path with optimal minimum total costs for the Iraqi's cities.
To verify our optimal result DP software obtained from [8]. implemented to solve Iraqi cities problem and obtained same result in compotation time 26007s.

Conclusions 1.
From Table 1.we conclude that the DP is an exact and efficient method for solving TSP for n  15 in reasonable time.2. The IMDM serves a good method as LB for BABT to solve the TSP for different n compared with other methods like GRM and BABM.3. The results of the practical examples of TSP, proof that the BABT1 is better than BABT2 in cost for n  25, while BABT2 is better in time for different n. 4. Since TSP considered as NP-hard problem, we recommend to use some perfect local search methods like, Genetic Algorithm, Particle Swarm Optimization, Bees Algorithm, …,etc, to find an optimal or near optimal solution.

Figure 1 .
Figure 1.show the comparison results of Table4.

Figure 2 .
Figure 2. show the comparison results of Table5.

Figure 3 .
Figure 3.The best path with optimal minimum total costs for the Iraqi's cites.

Table 3 .
Comparison results of BABT1 for the three models with each other for n=16,…,20,25.

Table 5 .
shows the comparison results between best of heuristic methods: IMDM with BABT2 for n=30,…,80 for average of (3) examples.

Table 6 .
The symbol of Iraqi's Cites.

Table 7 .
The distance (Km) between the Iraqi's cities.

Table 8 .
The Time (minute) between the Iraqi's cities.

Table 9 .
The results of the three suggested methods for different n with and without SR.