program tsp ! ! Travelling Salesman Problem ! Felix Andrews for PHYS3038 ! use tspglobals use tsputils use tspmc use tspanneal use tspevol use tspparsa implicit none call load_config trials = 0 distance_min = huge(distance_min) call random_seed call cpu_time( time_begin ) select case(run_type) case(MONTE_CARLO) call run_monte_carlo case(ANNEALING) call run_annealing case(EVOLUTIONARY) call run_evolutionary case(PARALLEL_SA) call run_parallel_sa case default print *, 'Unknown run type!' end select call cpu_time( time_end ) distance_min = tour_len(city_order_min) ! ! output results ! print *, '' print *, 'Number of city orders tried: ', trials print *, 'Trip distance: ', distance_min print *, 'Solution tour: ', city_order_min print *, '' print *, 'Execution time: ', time_end - time_begin, ' seconds' if (validate_tour(city_order_min) == .false.) then print *, '!!! TOUR INVALID !!!' end if end program tsp