COS 226 Programming Assignment Checklist: Backtracking for the TSP

Frequently Asked Questions

Which files should I submit? Submit everything you need except for the standard libraries and the standard data structures. Be sure to hit the Run-Script button to make sure everything compiles.

I can't access Rooks.java or Queens.java from the booksite. Sorry, the Algorithms in Java booksite is currently only accessible from the Princeton network. You can find the two files in the ftp directory. If you need access, send Kevin your IP address and he'll add it to the whitelist.

I get the same tour, but starting at a different point (or visiting the points in a different orientation). Is that OK? Yes, that's fine. Also, the distance might differ from the one in reference solution in the last one or two digits (as a result of floating-point roundoff error).


Input, Output, and Testing

Input. The directory backtrack contains a number of sample input files and optimal tours.

Output format. Your output format must exactly match ours: an integer N, followed by the N points (two double values using "%6.5f %6.5f" formatting), followed by the distance of the tour. We will use diff to compare your optimal tour against our reference solutions (though your optimal tour may use a different starting point or orientation.)

Testing.


Possible Progress Steps

These are purely suggestions for how you might make progress. You do not have to follow these steps.


Extra Credit Ideas

Here are a few ideas that are likely to improve the backtracking algorithm.