the adjacency matrix, programming homework help

Get perfect grades by consistently using www.assignmentgeeks.org. Place your order and get a quality paper today. Take advantage of our current 20% discount by using the coupon code GET20


Order a Similar Paper Order a Different Paper

Programming Assignment

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.

use this:

-	3	2	5_x000D_
-	-	1	6_x000D_
-	-	-	7_x000D_
-	-	-	-

Writerbay.net

Do you need help with this or a different assignment? We offer CONFIDENTIAL, ORIGINAL (Turnitin/LopesWrite/SafeAssign checks), and PRIVATE services using latest (within 5 years) peer-reviewed articles. Kindly click on ORDER NOW to receive an A++ paper from our masters- and PhD writers.

Get a 15% discount on your order using the following coupon code SAVE15


Order a Similar Paper Order a Different Paper