Friday, April 5, 2019
The Traveling Salesman Problem Computer Science Essay
The Traveling Sales adult male Problem Computer Science Essay stumbleing gross sales existence problem is unrivaled of the challenging problems in the real life and also closely well analyze combinatorial optimization problem. Many Re seekes from different fields like operational re attempt, algorithms form and including artificial intelligence attract by it. This problem has been studied by different re attemptes and come up with different solutions and this problem has been solved by utilise different algorithms like Blind wait, Branch and cumber Search , trial-and-error algorithm and Genetic algorithms etc. the problem was formulated as a numerical problem in 1930 and later it is used as bench mark for galore(postnominal) optimal solution.1.1 traveling SALESMAN PROBLEMA travel sales gentle gentlemans gentlemans gentleman has a task of visiting N number of cities. He leave start from a home reparation and want to visit severally city just at a time and legislate back to the original location from where he starts. Travelling salesman itinerary pull up s finds be cast in much(prenominal) a way that in a given N number of cities cost of change of location from one city to any a nonher(prenominal) city what is the minimum round trip travel guidebook that visit each city once and therefore return to the offset line place. The terminus is to baring the shortest act that visit each city in a given cities exactly ones and then return to the starting city. The unless solution to the travelling salesman problem is to calculate and comp ar the duration of all achievable arranged combinations.1.2 History of travelling salesman problemThe travelling salesman problem was treated by a Irish mathematician sir William rowan point Hamilton and British mathematician Thomas Penyngton kirkman in the early 1800s. Hamilton and kirkman work on game called Hamilton Icosian game that requires player to arrest tours through 20 points using only th e specified connections.The general form of the travelling salesman problem studied by mathematician Karl menger during 1930s. He defines the problem using brute force algorithms and observed nearest neighbour heuristic rule rule rule non optimality. Soon after the name travelling salesman problem introduced by hassler Whitney at princeton university. In the 1940s the Travelling salesman problem was studied by statisticians Mahalanobiss, Jessen, Gosh, Marks. Among them P.C .Mahalanobiss took a sample survey of acreage under jute in Bengal discussed aspects of travelling salesman solutions through randomly elect locations in the Euclidean plane. And this work is deal with survey of form lands one of the major cost to carrying out the survey was the transport ion of men equipment from one survey point to neighboring. During the menses among 1950s and 1960 the problem becomes much popular in scientific group in atomic number 63 and USA. a number of solutions designed by George B.Da ntzing, Fulkerson and Johnson(1954) . in 1954 Heller published an 88 report which checkers many basic solutions on the travelling salesman polytype. In 1957 L.L.Barachet published interpretic solution of travelling salesman problem which describes an instrument scheme for computing near optimal tours.In 1964 R.L Karg and G.L. Thompson were applied heuristic algorithm for a 57 city problem. During the period R.M Karp and M.Held published an article about the travelling salesman and minimum spanning maneuver which introduced one tree relaxation of the travelling salesman problem and using thickening weights to improve the bound given by optimal tree. In 1990s Bixby and Cook developed the programme for travelling salesman problem which are using recently.2.0 chart2.1 Travelling salesman problem modelled as graphTravelling salesman problem can buoy be modelled as graph where as the cities are the graph vertices, path is graph edges and path quad is edge distance. Our goal is to find the shortest tour that visits each city in a given graph exactly ones and then return to the starting city.3.0 Search AlgorithmsTo solve travelling salesman problem we can use different types of algorithms like screenland chase, heuristic algorithms, uniform cost search etc3.1 Blind searchBlind search algorithms are such algorithms which does not contain domain knowledge of the problem and it search devicely, hence it is called guile search algorithm. The only thing a blind search can do is it describes a non goal utter from goal state. Assume that you are at city A and you want to earn at city D, if we lactate a search tree level 1 city E, city B, city C. a blind search will have no idea which client should explore low gear, hence it explore each and every guest blindly. In blind search we may not get information we can use. We just be looking for an answer and we wont no until we implant it. The blind search is also called as un informed search.Blind search is div ided into two searches Algorithm they are1) pretension number one search and2) knowledge premier search3.2 Breadth prime(prenominal) searchBreadth firstly search is a search which starts at one node and it expands the all the neighbour node then after completing those nodes, it expands remaining nodes unexpanded it process is continues up to reaching a goal.The technique followed by width first search is FIFO first in first out) queue, the difference between breadth first and profoundness first search is, the depth first uses stack i.e.LIFO (last in first out). In this logic the items which are added is equal to the item which are deleted. This process continues up to reach a goal.3.3 Depth first searchDepth first search is a general technique for traversing a graph. The technique which organise the to Do list was stack that is last in first out (LIFO). Depth first search start at one node and it explore as far as possible along each branch until a required goal node is foun d.Then it takes inverting and return to the succeeding(a) node which it hasnt finished exploring and it keep on repeat the same procedure until it reaches to its goal. If Depth first search goes down a infinite branch and if it does not find a goal state or if it does not find the solution may be a better solution at a higher level in tree. Therefore depth first search is neither wind up nor optimal.ALGORITHMINPUT A connected graph G ,a starting vertex 1 getup An ordered spannig tree T of graph G with root vertex 1Initialize tree as vertex 1Initialize S as the set of proper edges incident on vertex 1While s not equal to nullLet e = dfs next edge(G,S).Let w be the non tree end point of edge e.Add edge e and vertex w to tree T.Update Frontier(G,S).Return Tree T.4.0 DEPTH FIRST SEARCH moderate TO GRAPH scratch line AT NODE 1For the above tree diagram we are using Depth first search, from the graph the sales man starts at node a and visits each node and return to original nodeStep 1 from node 1 there is a trine shipway to travel i.e. node 2, node3 and node5 in level 2Step2 by following depth first search anatomy LIFO it expands node 2 until the goal reachSo for node 2 there is a two ways to travel i.e. node5 and node4 there is only one way for sales man to reach node 3 so this is not minimal path to travel.After expanding first branch sales man reaches node 3 from node 3 sales man reaches node4With path space of 8 and from node 4 he reaches node2 with path length of 5 and from node 2 sales man reaches node5 with path length of 6 then length of whole sub tree is 27.After expanding of fleck branch sales man expands node 5, from node 5 sales man travels node 2 with path length of 6 then from node2 sales man reaches node 4 with path length of 5From node 4 sales man reaches node 3 path length of 8.then length of whole sub tree is 26Here we follow the condition that sales man will not visit those not which have already visited. the left vertices in the graph a re chosen before right, from above to roots the minimum spanning tree path is 1-5-2-4-3 =26.this is the scoop up minimum root for sales man to visit each city started at city1.4.1 DEPTH FIRST SEARCH APPLYING TO THE GRAPH STARTING AT NODE 2For the above tree diagram we are applying depth first search on which sales man starting at node 2. From starting city we have three ways to travel i.e. node 1, node4 and node5. From node 1 sales man has again to two ways to travel i.e. node3 and node5.from node 3 it reaches node 4.but here if we want to visit node5 we have to backtrack again it will not satisfy the condition visiting a city once so we didnt reach goal here sales man expands neighbour node 4, from node 4 sales man reaches node 3 with path length of 8, then sales man elegant to node 1with path length of 8, then sales man visits node 5 from node 1 with path length of 7.The length of whole sub tree is 2-4-3-1-5=28.After expanding node4 travel sales man moves to node 5, from node 5 he reaches node1 path length of 7,from node 1 sales man reaches node 3 the path length of 8 and he proceeds to node 4 from node 3 with path length of 8,then whole length of sub tree is 2-5-1-3-4=29.Here sales man follow the condition that visiting each city, then the the scoop up minimum cost route starting at node 2 is 2-4-3-1-5=28.5.0 INFORMED SEARCHInformed search is an thought availability of the distance (cost) from each node(city) to the goal. This estimation will help you to head into the correct direction.The outline of inform search are heuristic search, best first search, greedy search and A* search5.1 Heuristic searchHeuristic uses domain specific knowledge to estimate the quality or potential of partial solution .A heuristic search that find a severe solution in less time comparing to blind search but not always find best solution. This search is very much utilitarian for solving big problem which may may not solved by using other search and this search generate a pos sible solution which can be either route from the initial location or goal in the problem. For travelling salesman problem the nearest neighbour heuristic work well, but some time due to the arrangement of cites it will not find the shortest route.5.2 exceed first searchBest first search is a general approach of the tree search algorithm. In which it expand a nodes which is based upon a military rank function. The estimation of cost is constructed as evaluation function then the node with minimum evaluation is expanded first. A best search is a combination of both(prenominal) breadth first search and depth search, a breath first is good because it will not go deeper and the depth first search is best because it can be found without searching all the nodes, hence the best first search allows us to gain benefit both the approaches5.3 Greedy searchGreedy search select the path that has lowest heuristic value or estimated distance to the goal. Greedy search is a example of best first strategy, and it some cases like depth breast search I may never find the solution and greedy search is not optimal solution take into costly paths . This can be happen in the last tone or in the first step.5.4 A* searchThe most widely known form of best first search is called a* search or best first search is simplified as A*search. The evaluation of nodes is carried in A* search was combination of g(n) the cost reached and h(n) the cost get from the node to the goalf(n)=g(n)+h(n)Here f(n) estimate cost of cheapest solution through node n, A* search is both complete and optimal which is identical to uniform cost search.From the above equationg(n) is the total length between starting place to current location.h(n) is estimated length from current location to goal. A heuristic function which estimate how much distance it takes to reach goal.f(n) is the sum of g(n) and h(n) .then this will be a current estimated shortest path which founds until a A* algorithm is completed.A* Algorit hmA* Algorithm starts with initial nodes then it will take the best node on open such that f(n)=g(n)+h(n) is minimum. If Best is a goal node take leave then return to the path from the intial to best or remove the best from open and all among best node naming each node with its path from initial node.6.0 A* Algorithm applying for given graphfrom the above graph , it shows that the node 1 is the initial node where salesman starts and reaches the node 3 which is the current location . then sum of the distance between initial to current location is consider as g (n) ie 1-5-2-4-3= 26.then the estimated length from current location to the goal is consider as h(n) ie 8 and then total minimal distance of path isA*=1-5-2-4-3-1=34Then this is the minimal path in which salesman can travel starting at node 1.7.0 Comparison table for depth first search and A* algorithmAlgorithmDomain knowledgeMemory spaceMinimum route succession complexityefficientDepth first searchIt doesnt contain domain kno wledgemoreIt find after complete searchIt takes more timelessA* searchIt contain domain knowledgelessIt has information about itIt takes less timemore8.0 CONCLUSIONThe brain of Travel sales man problem has much application in different fields .To limit best routes of travelling salesman we are used two algorithms they are DepthFirst search and A* Algorithm. Hence we conclude that A* algorithm is more efficient then depth first search algorithm, the time complexity of depth first is more comparing to A* search and it takes less warehousing space comparing to depth first search. Depth first search algorithm is more capable finding minimum tour for limited number of cities, because if we take 50 to 100 cites depth first search expands each node of a tree to reach to the goal which is time consuming and store waste.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.