This project implemented four advanced algorithms to solve the famous NP-Problem Travelling Salesman Problem. The four advanced algorithms are:
- Branch and Bound
- Farthest Insertion
- Interated Local Search
- Simulated Annealing
- Make sure all the java files and the DATA folder are in the same directory.
- Type "javac Main.java" in the command line to compile.
- Type "java Main" in the command line to run the project.
- Type "make clean" in the command line to delete all the class files.
- Entry point -> Main.java
- File handling
- Read input file -> FileInput.java
- Create city instances -> City.java
- Implementing algorithm -> Algorithm.java
- Brach & Bound algorithm -> BranchAndBound.java
- Farthest Insertion algorithm -> FarthestInsert.java
- Iterated Local Search algorithm -> Iteratedlocalsearch.java
- Simulated Annealing algorithm -> SimulatedAnnealing.java
- Unit test -> ProjectTest.java
- File handling
Both the solution file and the trace file will be generated by the program. The filenames will include the name of the city to implement the algorithm, the abbreviation of the algorithm's name and the cut-off time.
Solution file will include the resulting path of travelling each location exactly once in the city and the corresponding total distance travelled.
Trace file will include the total distance calculated corresponding to the program running time.
- Reason: the DATA folder is not correctly put in the root directory of the project workspace.
- Solution: put the DATA folder in the root directory of the project workspace.
Hezijian Xiao, Ruoyu Ji