Define difference between any two of these n citie

Assignment Help Computer Engineering
Reference no: EM1331709

Assume you are given a set of N < 10 cities with pairwise distances between them represented as real numbers. A traveler starts from city #1 and wants to visit all other cities just once and return back to the origin. Assume there is a direct airline between any two of these N cities. Your task is to design a C++ program that will find an optimal route for the traveler. That is, the program should return a route of minimum total length. Assuming that the traveler always starts from city 1 the output of the program for N = 4 should be of the form
1 -> 2 -> 4 -> 3 : 226.6

where the last number is the minimum total distance.

Create a file dist.dat for storing the pairwise distances represented as an NxN table of numbers. The number at the intersection of the i-th column and j-th row is the distance from city i to city j. So the table is symmetric; that is, the number at the intersection of row i and column j is the same as the one at the intersection of column i and row j. Note that the number N of cities is not presented explicitly in the file, your program has to figure it out. Your program should read the data from the file by using the input redirection.

Example of such file for N = 4:

56.78 11.80 79.34 78.23
11.80 16.26 65.23 45.19
79.34 65.23 63.29 90.27
78.23 45.19 90.27 87.35

Create your own file for at least 7 cities.
Your program should work for any N in the range [3..10]

Reference no: EM1331709

Questions Cloud

International and cross-cultural negotiations differ : Discuss in what way international and cross-cultural negotiations differ.
Strategic plan development for tuffs : Strategic Plan Development for Tuffs-NEMC Could you please assist me in understanding the development of the Executive Summary
New home sellers in a given market decreases : The number of new home sellers in a given market decreases.
Handling the death penalty case : List the various courts and hearings that will typically occur and how the case is affected by each event.What are the relevant civil liberties issues pertaining to the 4th, 5th, 6th, 8th, and 14th Amendments present in this case?
Define difference between any two of these n citie : design a file dist.dat for storing pairwise distances represented as an NxN table of numbers. The number at the intersection of the i-th column and j-th row is the distance from city i to city j. So the table is symmetric.
Describing virtual group charter : Suggest a formal "Virtual Group Charter." At a minimum, the charter should contain a group name, specific rules for engagement, norms of expected behavior, and selection of a formal leader.
Organizational ethics and social responsibility : Description of Organizational Ethics and Social Responsibility - The company lost some great people because performance was not considered, only seniority.
Management of resources : The management of the human element of the organization or the management of technology?
Standard form contracts : Standard and bespoke contracts - Compare the relative advantages and disadvantages of standard form contracts and "bespoke" individually negotiated contracts

Reviews

Write a Review

Computer Engineering Questions & Answers

  Briefly explain the difference mesh, bus, ring, and star top

Briefly explain the difference, including advantages and disadvantages Ethernet, Token Ring, FDDI, and Wireless.

  Discuss the tester and developer relationship

Discuss the tester and developer relationship within spiral development methodology. You may use your personal experiences to support the arguments.

  Define the best possible scenario for an organization

If in a hypothetical situation your company was capable to hire only either technically sound managers with weak leadership skills OR strong leaders with less knowledge/interest in routine management, that would you opt for and why.

  Write down an equation and draw a circuit

offer below is a truth table for a combinational logic circuit with three inputs and one output. Write an equation and draw a circuit which implements the function represented by this table.

  Describe the difference between dhtml and html

explain examples of JavaScript script usage in a commercial setting.

  What is total capacity of a track

What is total capacity of a track

  Decision making systems

How we may leverage business intelligent to generate meaningful information and decision making systems in order to help the keep cost and the profits.

  Security policy document project

Analyze security requirements and develop a security policy

  Powerpoint 2010

Which among the following statement is TRUE regarding the PowerPoint 2010? Provide the answer providing the reson:Any PowerPoint presentation is saved with a .ptt extension after filename.

  Preparing a copy of hard drive

After we have the target media prepared and assembled along with all our tools assembled for investigation we should now make a copy of hard drive.

  Write down an assembly language program

Write down an assembly language program The product number from one to five (3 characters wide, right justified)

  Analze the letter grade the student has earned

suppose the full score for each assignment is 100. Student will get 0 for each unsubmitted assignment.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd