In this project, you will compare accuracy and the theoretical and empirical complexity of different algorithmic solutions to the traveling salesmen problem (TSP).

- Wrestle with an NP-complete problem
- Implement a greedy algorithm for finding solutions to the TSP
- Implement an algorithm of your choice to get high accuracy “approximate” TSP solutions in “reasonable” time
- Develop your ability to conduct empirical analysis and understand resource trade-offs by comparing your algorithm, the greedy algorithm, and your branch and bound solution (project #5) for TSP
- Work effectively as a group

This will be a group project on which you will all work in teams of 3-4 students. Your team assignment can be found on Moodle. As a team you will hand in one report and also do one group presentation on the last day of class. Your team will all receive the same base grade for the project. To augment this, each team member will e-mail me a thoughtful and honest evaluation of the contributions of their team members, including themselves. For each individual, this evaluation should include a score from 1 to 10 indicating your evaluation of their work (10 meaning they were a valuable member of the team that made significant contributions to the project and were good to work with, 1 meaning they contributed nothing and were difficult to work with). If you would like, you may also include any clarifying comments, etc. (especially for low scores). If a person receives consistently low evaluations from peers, then their score will be proportionally decreased.

You will use the same framework used for the TSP Branch and Bound project, implementingmethods for (at least) two additional solver techniques. If you are considering an early starton this project, and have not yet looked carefully at Project 5, you should do so now. Since this is a team project, it is not necessary for every member to extend their B&B project. Instead, choose one person's code and work on it collaboratively.

Your goal will be to implement an algorithm which can solve the largest possible city problems with the most possible accuracy (approximation) in “reasonable” time. You can use any algorithm you come up with. It is all right to look on the web or elsewhere to find algorithms, but you should write your own code. Note that since we are requiring"reasonable" runtimes, your algorithm will likely not find optimal length tours (unless you make a huge breakthrough!) You may not use branch and bound with different bounding functions as that would not give you as much of a new experience.

To help make the presentations a better educational experience, we will have no more than 3 groups doing the same (or very similar) algorithm. As soon as you know which algorithm you want to do, send me an e-mail. This will be first come first serve. If 3 groups choose a similar approach, I will immediately send out an e-mail stating that that approach is no longer available.

- Implement a greedy algorithm which starts from an arbitrary city, picks the shortest path available to an unvisited city, then picks the shortest path from that city to an unvisited city, etc., until it returns to the origin city. Note that for Hard problems, it is possible to reach a city which has no paths to any remaining unvisited cities (don't forget to check for a path from the last city back to the first to complete the cycle). In such cases, there is no legal solution (unless you backtracked which you don’t here). Your algorithm should iteratively try starting from each city and return the best solution found for any of them.
- Implement your own algorithm of any type (except B&B) to solve the TSP. You will use the default random and your greedy algorithms as a baseline and see how much better you can do. The best algorithms will have a good combination of
- % improvement in solution quality (tour length) over random and greedy
- size of problem (# of cities) that can be handled

- % improvement over greedy
- the size of problems it can handle
- the creativity of your algorithm

- As with project 5, there are three difficulty levels that govern the city distributions: Easy (symmetric), Normal (asymmetric), Hard (asymmetric and some infinite distances). You can play with all of them during testing but just use the Hard level for all of your reporting below. Note Easy employs a Euclidean distance function; Normal, a metric distance function; and Hard, a non-metric distance function. With a Euclidean distance function, the optimal tour can not have crossed paths; however, in the case of a non-metric distance function, the optimal tour may have crossed paths”. Also, as with project 5, all the resultsthat you report should be on problems of the Hard variety.

- [10] Correct implementation of the greedy TSP algorithm. Brief discussion and complexity of the algorithm.
- [40] Correct implementation of your own TSP algorithm including a discussion of the algorithm, why you chose it, and its pros and cons. Give proper attribution (references) for ideas you find externally. Clearly point out which ideas came from other sources, and which ideas are original contributions that you made. You do not need to include source code in your hardcopy, nor e-mail your source. Also include a discussion of the theoretical big-O complexity of your algorithm, and discuss how the empirical complexity matched that. Include screenshot examples of typical results for both algorithms (greedy and yours).
- [35] Include a table with columns (see below) for each of your TSP algorithms including the Branch and Bound TSP algorithm you implemented in Project 5 (use one of your individual project 5 implementations as a representative version of B&B; however, do not set your time limit at 60 seconds as you previously did). For the random algorithm, use the default algorithm provided with the original framework (this acts as baseline for the greedy algorithm). You can play with all three levels of problem difficulty (Easy, Normal, Hard) during testing, but just use the Hard level for all of your reporting. For the greedy algorithm report the improvement over random as a fraction [calculate this as greedy_cost/random_cost]. This will help calibrate and make sure your greedy algorithm is implemented correctly. For B&B and your own algorithm, report the improvement over the greedy algorithm (this should be a positive number representing how much better your tours are as a fraction of the greedy tours). You should create a table just like the one below and with the city sizes shown below (15, 30, 60, 100, 200), so that we can easily compare with each other’s work. Round average tour lengths to the nearest integer. Round time and % improvement to two significant digits beyond the decimal. Your results for each cell should be the average of some number (at least 5) of runs with different random seeds for that number of cities. Do not try to find a particular set of seeds on which your implementation does best. They should be randomly chosen runs. You will fill in average time (seconds) and average tour length for the different numbers of cities. If an algorithm takes more than “reasonable time” (more than about 10 minutes or so) to solve for that number of cities, then just fill in the cells for that algorithm with “TB” (Too Big). You can also include any other information you feel is interesting. The numbers in the example table below are made up but should be somewhat representative.

To complement the required five rows shown in the table above, you should also add to your table some additional rows (different numbers of cities). In particular go as large as you can before getting “Too Big.” The last row of your table should be the largest number of cities which can be done in a reasonable time limit. Discuss and analyze the results in your table.Random Greedy Branch and Bound Own Algorithm # Cities Time (sec) Path Length Path Length % of Random Time (sec) Path Length % of Greedy Time (sec) Path Length % of Greedy 15 0.00021 7743 4100 0.52 3.26 3527 0.86 1.47 3649 0.89 30 60 100 200 0.11 100761 15798 0.16 TB TB TB 165.01 14244 0.90 ... - [5] Your write-up should look sharp and follow the form of a brief conference paper with abstract, introduction, algorithm explanation, complexity, analysis of results, and future work.
### Oral Presentation

- [10] Each group will give an oral presentation of their project on the last day of class, consisting of a short slide presentation (4 minutes). Do not take time in the presentation to discuss the TSP problem or its basic greedy and Branch & Bound solutions, as everyone will already be familiar with these. Instead, the presentation should
- introduce and explain your algorithm (along with this briefly review why you chose this algorithm, how much is original while giving appropriate attribution, any challenges/detours along the way, and the pros and cons of your approach)
- present and discuss the theoretical big-O complexity of your algorithm
- show and discuss your version of the table above
- (briefly) describe what next steps you would try if you had more time to work on the project

*no more*than one slide per topic point above, should be professional, and will need to bepracticed to make sure it fits the time constraint (given the short amount of time allotted, it is probably wise to select a single group spokesman for the presentation).