Question: C++ Greedy Search Problem Write a greedy search to find a closed path connecting a list of points (the Travelling Salesperson Problem) and output its

C++ Greedy Search Problem

Write a greedy search to find a closed path connecting a list of points (the "Travelling Salesperson Problem") and output its length. (A greedy search always goes next to the nearest unvisited point.) You may assume that x and y are non-negative integers that will fit in a 32-bit int. Each line of keyboard input will be the x and y coordinates for a point; keep reading until EOF. You may assume there will be no more than a million points. For example, if the input file contains 
0 0 0 1 1 1 1 2 the output is (probably) 5.236. 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!