Parallelization of travelling salesman problem (TSP) using PyCSP
Used as an example in the presentation: "Communicating Sequential Processes (CSP) - An alternative to the actor model"
The implementation models TSP as a complete, undirected weighted graph, and implements the branch-and-bound optimization. The parallelization uses a master-slave pattern, and requires Python 3.
python run_sequential.py <num_cities>, where
num_citiesis number of cites/node in TSP
python run_parallel.py <num_cities> <task depth> <num workers>, where
num_citiesis number of cities/nodes in TSPtask depthis the length of sub-routes the master will use as tasks in the parallelization. A larger task depth results in more tasks.num workersis number of workers that will be spawned
- iter1: Does not use branch-and-bound optimization in parallelization. Less complexity.
- cluster: Minor modification for using the cluster module in PyCSP.