subject

This assignment is based on the definition of the Traveling Salesperson Problem (the TSP): Given a set of cities, you want to find the shortest route that visits every city and ends up back at the original starting city. For the purposes of this problem, every city will be directly reachable from every other city (think flying from city to city). Your goal is to use a non-genetic local search algorithm or algorithms from Chapter 4 of Poole & Mackworth to find the shortest paths that you can. Note that for any reasonably sized problem, you will not be able to try every possibility, and so you won’t ever know when you have the shortest possible path. You should have two types of output: Summary Mode and Verbose Mode. Verbose Mode should print to a file every path you try until your program terminates. Summary mode, which prints to the console, should print a path only when that path is better than any path that you have found previously. In all cases, print the single-letter mnemonic of the city (Node), not its full name.
Suggestions
You can start from any city you want, it really doesn’t matter which. For example, you can start from the first city in the file, since it is the easiest. Create some tours. You can do this randomly, or you can use a greedy algorithm of some sort, or you can just visit the cities in the order they appear in the file, whatever you prefer. Your choice probably won’t affect the goodness of your final tour, but it might affect how long it takes you to get to a good solution. Selecting and using the techniques of local search, try to find a better tour. Be sure to document what you’re trying to do. The rest of this section assumes you want to create your own algorithm. Here are some thoughts on what is probably the main question: how to step from one possible tour to the next.
One option would be two swaps the order of two cities and see if this shortens the tour
Mpls. => Seattle => Detroit => Boston => Chicago => Miami => Denver => Mpls.
Or you could pick one city in the tour, and try removing it and inserting it between every pair of cities to see which gives the shortest tour.
There are other forms of Iterative Best Improvement, too.
When deciding what cities to swap or what city to shuffle, you could use either a 1-stage or 2-stage choice algorithm.
With any sort of iterative best improvement, there are various techniques you could use if you wish. One of the big differences among peoples’ algorithms will be their choices to use or not use these techniques, and the algorithm they use to decide when to use them (for example, how often to do a random step or restart, temperatures for simulated annealing, etc.)
• You could choose to use Simulated Annealing to decide whether to keep a given tour even if it’s longer than the existing tour.
• You could inject randomness by sometimes making random permutations (random walk).
You could decide after a certain number of iterations that you should just start over from scratch with a random order of cities (random restart).
• You could choose to keep a tabulation list or not, and if you do, you could choose its size.
• You could keep multiple tours, and permute them in parallel (beam search).
Since you don’t actually know when you have an optimal tour for any reasonably sized problem, you need to decide on a stopping criterion. Some possible suggestions:
• Stop after some number of steps (where the number of steps might be some function of the number n of cities).
• Stop after you have gone some number k of steps without improving on your best answer.
• Stop after the program has run for some amount of real-time (measured by something like System. time. millis()).

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 02:00, itsyagirl11076
What is the process in which the software development team compiles information to determine the final product.
Answers: 3
image
Computers and Technology, 22.06.2019 15:10, reycaden
David is in week 3 of his current ashford course and has a paper due by monday night at midnight. he has finished everything but the concluding paragraph. as he boots up his computer to work on it, he sees a flash across the screen and then the screen goes black. he begins to panic as he tries desperately to turn the laptop back on. david should have saved his work on what kind of portable device?
Answers: 2
image
Computers and Technology, 23.06.2019 10:20, chonawilson4
Suppose there is a relation r(a, b, c) with a b+-tree index with search keys (a, b).1. what is the worst-case cost of finding records satisfying 10 < a < 50 using this index, in terms of the number of records n1, retrieved and the height h of the tree? 2. what is the worst-case cost of finding records satisfying 10 < a < 50 and 5 < b < 10 using this index, in terms of the number of records n2 that satisfy this selection, as well as n1 and h defined above? 3. under what conditions on n1 and n2, would the index be an efficient way of finding records satisfying the condition from part (2)?
Answers: 1
image
Computers and Technology, 24.06.2019 13:00, pineapplepizaaaaa
If you add the following to the query grid in an access query, what is it called? salestaxamt: [salestaxrate]*[totalsale] formula calculated field total calculation
Answers: 2
You know the right answer?
This assignment is based on the definition of the Traveling Salesperson Problem (the TSP): Given a s...

Questions in other subjects:

Konu
Mathematics, 08.05.2021 03:00
Konu
Spanish, 08.05.2021 03:00