U.C. Berkeley CS267: TSP Specifics
Here are a few things you may find helpful:
What to assume: Make no assumptions about the size of the matrix
(although you can probably guess that it'll be on the larger
size). Also, as stated in
the assignment, make no assumption about the
topology (i.e., Euclidean N-dimensional, Triangle inequality, etc.).
You'll be given a
square distance matrix in standard matlab format. That is,
if 'm' is a matlab matrix, the format will be what
matlab writes out in the following command:
save filename.mat m -ascii
(Note how matlab saves infinities, but if you use scanf for reading,
it should be able to handle them properly.). Please call your program 'ptsp'
and accept
arguments such that the following will work:
(your_path)/ptsp -n {matrix_size} -f {matrix_file}
Yes, the '-n' argument is redundant (you can
get this information from the matrix_file) but we thought
that providing a '-n' argument would make parsing
the file a bit easier. Your program, of course, will
need to be world executable.
You'll get to run your program for about 5 minutes on
a dedicated 32 processor CM5 (i.e., rodin, note 32MB/node). Although
this isn't the most accurate way, we'll judge
relative program performance by having
someone (guess who?) hit ^C about 5 minutes
after starting the program.
The last complete
tour that has been printed to the screen
will be accepted as your group's final solution.
This means you'll have to balance the I/O printing
granularity and computation tradeoff appropriately.
Please output the solutions on a single line in a list-of-cities format.
Follow it with the current tour length
so we can get an idea on how things are going. For example, each
tour output should be:
1 c2 c3 c4 ... cn 1
current_tour_length
I.e., output a row vector on one line followed by a number
on the next. c_i is a
number from 2 to N, where N is the number of cities, and
c_i != c_j, for i != j. This means we'll start
and end with city 1.
Each final solution
will be verified as a valid tour, and the shortest
tour wins. While a group's program is running, one
group member will give a brief overview of the
algorithm while the rest of us watch.
So, as a checklist before the race:
- Mail me your
group members.
- In the above mail, send me the path to your program that
will work during the race.
- Make sure your program is world executable.
- Make sure your program accepts the correct arguments.
- Make sure your program prints solutions using single
line format followed by the tour length.
- And finally, make sure your program works!!
Good luck to you all!!