K
KantKwitDansin1
I have the following assignment, but I am not familiar at all with .dat
files and how to use them as input and to generate a .dat file as
output. Our final grade is based on if the program works on the
running time. Could someone please assist me with this problem.
Thanks!
Traveling Sales Man
--Problem Description: A salesman must visit n cities. He wishes to
visit each city exactly once and finish at the city he starts from.
There is an integer cost c(i, j) to travel from city i to city j, and
the salesman wishes to make the tour whose total cost is minimum, where
the total cost is the sum of the individual costs along the edges of
the tour.
* Input: city.dat, containing a 10 x 10 adjacency matrix of positive
integer cost.
* Output: tour.dat, containing a 1D array of the tour path.
files and how to use them as input and to generate a .dat file as
output. Our final grade is based on if the program works on the
running time. Could someone please assist me with this problem.
Thanks!
Traveling Sales Man
--Problem Description: A salesman must visit n cities. He wishes to
visit each city exactly once and finish at the city he starts from.
There is an integer cost c(i, j) to travel from city i to city j, and
the salesman wishes to make the tour whose total cost is minimum, where
the total cost is the sum of the individual costs along the edges of
the tour.
* Input: city.dat, containing a 10 x 10 adjacency matrix of positive
integer cost.
* Output: tour.dat, containing a 1D array of the tour path.