Final Project for INFO 6205 Program Structures and Algorithms
This project is a genetic algorithm to find a solution to the Traveling Salesmen Problem. I approached the problem as finding the Hamiltonian circuit with the smallest weight on a complete weighted undirected graph.
The program uses both sexual and asexual reproduction to generate new solutions. A solution is evaluated based on the inverse of the sum of the weights for each edge visited, so that the shortest path has the highest score.
This project uses:
- By default three parameters can be set - the number of vertices in the graph (default 50), and the maximum weight of each edge (default 5). To change these edit Main.java.
- The program creates a random complete weighted undirected graph. Random is seeded so that solutions can be compared.
- You can run the algorithm in Eclipse or on the command line with Maven.
- Output is saved to log4j-application.log
Unit tests can be run in Eclipse or on the command line with Maven.
- Emily Strong
The code for creating a weighted undirected graph is based on code from:
Sedgewick, R., & Wayne, K. D. (2015). Algorithms. Upper Saddle River (NJ) etc.: Addison-Wesley. Booksite: https://algs4.cs.princeton.edu/home/