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

  Hardware support to memory management

Study any two multicore processor architecture and discuss the following features briefly

  Elements of physical security

Develop a physical security plan for manufacturing company. Your paper must include an explanation of the physical security and the different elements of the physical security.

  Design class called dog which keeps track of the dog''s name

design class called Dog which keeps track of the dog's name, breed, age, and license fee. The license fee will be a set amount: $12.25, since you only need one copy of this in memory, make it static. Include a method which prompts a user to set th..

  Draft the testing procedures to be used by groover

Draft the testing procedures to be used by Groover Consulting whenever they provide software to their clients. The procedures will be used by Groover Consulting to that the software they are delivering is reliable, accurate, and fault tolerant.

  What is the data type of the arrays

What is the importance and use of keyword "new" when associated with a Java array.

  Mips single-cycle datapath processor

An instruction is being executed on the MIPS single-cycle datapath processor. Which class of instruction is being executed over the processor? b) Will you specify which instruction is being executing?

  Fetching and executing instructions

Explain the format for this instruction and then formulate a procedure for fetching and executing the instructions for this computer.

  Define four phases of an information system''s life cycle

What are the 4 phases of an information system's life cycle? The business process of building and managing information system has four phases. These phases apply to all information systems although different systems may be acquired using different..

  Make use of a constructor to initialize employee information

make use of a constructor to initialize employee information. A payroll program that calculates the employees weekly pay after employee's name, hourly rate, and number of hours worked.

  Define purpose and role of an is steering committee

What is the purpose and role of an IS steering committee, or advisory board.

  Why employees may leave the company

Do you think that it is acceptable for organizations to try to lock employees into a work term after training? In other words, if they send an employee on the training course that could have tremendous benefit to the organization, should they be a..

  How to display the largest and smallest amount of tax

Ask users for the past 5 years of federal taxes they have paid, save this data to an array, search for the largest and the smallest amount of tax, and show it on the screen.

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