my tiered assignment thabit

timer Asked: Nov 21st, 2016

Question description

computer sinsce

Programming Assignment 3 Consider the travelling salesman problem where a salesman travels several cities where:  He departs from and returns to the same city  Every time he travels to the closest city, i.e. having shortest distance from origin. Given the input as a text file having the adjacency matrix, i.e. matrix containing the distance between each pair of cities, write a program that parses this input and allows the user to choose a city of departure and builds a circular linked list where each node contains the name of the visited city and the distance from the previous city. Then, the program displays:  the path obtained from the circular linked list, i.e. list of visited cities in order based on the choice provided by the user  the optimal path, i.e. the least overall distance and its corresponding city that should be chosen as city of departure and it corresponding path Your program should have:  City class to store the name of the city and the cost to go to that city. The cost should be populated, in runtime, after choosing the city of departure  Node Class and CircularLinkedList class: You can build on the ones that we saw in class  Source .cpp file contains the main method to parse the text file and contains the main logic of your program Deliverable: zipped file of the Visual Studio project file. Note: The matrix is symmetric so only the upper part is provided. You should parse it as string then transform the distances to integer. You can name the cities as you wish. You can define a string array string cities[4] = {“a0”,”a1”,”a2”,”a3”}; assuming a0, a1, a2 and a3 correspond to the cities represented by 1st, 2nd, 3rd and 4th rows/columns.

Tutor Answer

(Top Tutor) Studypool Tutor
School: UCLA
Studypool has helped 1,244,100 students
flag Report DMCA
Similar Questions
Hot Questions
Related Tags
Study Guides

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors