-2

I'm currently working on TSP which has been given to me as my end of year project in my computer science course.

In this problem we are given a list of the top 1000 colleges in the world. Then starting at our own colleges, we have to travel to all the other colleges once and make it back to ours. But we are only allowed to travel to colleges that are within 100 rank of college that you are currently at, with no wraparound at either ends of the list.

I tried to approach it using nearest neighbour but I kept on running to a problem where my code would get stuck at a certain university because it would have already travelled to all the other colleges within 100 rank of it. I am now currently trying to use a genetic algorithm to solve it but I'm running into some issues.

Is there any other algorithm that would be good for this problem that I could use in the meantime while trying to fix my genetic algorithm?

  • 1
    This restriction shouldn't change your algorithm at all, it only changes the graph it operates on. You would normally have a complete graph (all vertices connected to each other) but now some of those links are missing. – Ulrich Eckhardt Apr 29 '18 at 12:10
  • Do you just need to find a path or do you also have to make the path length minimal? – luksch Apr 29 '18 at 12:19
  • @luksch Yeah I need to do both –  Apr 29 '18 at 12:22
  • @UlrichEckhardt That makes sense, I guess I just have to do a bit more work with my algorithm –  Apr 29 '18 at 12:23
  • Okay. And is your algorithm expected to also optimize runtime? Is is okay to find a non-optimal solution but in better time? Genetic algorithms are great, but usually used for high dimensional optimization, when it is not possible to enumerate all solutions. If runtime is of less importance, then you probably should look into solutions that cleverly try out all possibilities and find the optimal path by comparing them all amongst each other. – luksch Apr 29 '18 at 12:37
  • @luksch Shortest path is the main focus with regards to solution. Because my lecturer is using competitive marking, the person with the shortest paths gets the most marks and if 2 or more people are tied then it is judged by runtime. So I suppose runtime is of less importance. I was thinking about cleverly trying out all the possibilities but I'm not sure as to what algorithm(s) I can use to implement that, in a way that would run relatively quickly. –  Apr 29 '18 at 12:43

1 Answers1

1

I can't solve your problem for you, but the TSP is a very well known and studied problem in computing science. There is tons of literature about it. If I was you I would start reading some of the publications and try to understand to which sub-type your problem belongs. Then find the best known algorithm for it, read about it, understand it, implement it. Lastly, optimize your solution.

Some pointers:

https://medium.com/basecs/speeding-up-the-traveling-salesman-using-dynamic-programming-b76d7552e8dd

https://www.cl.cam.ac.uk/teaching/1516/AdvAlgo/tsp_demo.pdf

http://mpc.zib.de/index.php/MPC/article/viewFile/18/8

luksch
  • 10,564
  • 5
  • 32
  • 48
  • 1
    And ... don't restrict yourself to just these references. Do some searching for yourself. I'm sure that's what your project supervisor would want. – Stephen C Apr 29 '18 at 13:43