Question: Needing to implement a greedy best first search in C++ code. With the required instruction below: Write the program in C++, also test the input,

Needing to implement a greedy best first search in C++ code. With the required instruction below:

Write the program in C++, also test the input, inorder to get the similar output as shown below with same length.  1.) Given a file containing a list of points (x,y) in the plane, write a greedy best-first search to find a closed path connecting all the points (the "Travelling Salesperson Problem") and output its length. You may assume that x and y are non-negative integers. Each line of input will be the x and y coordinates for a point; keep reading until end of file. You may assume there will be no more than 10000 points and that the input file will be named Test_data.txt. The test points will need to be read from that file. 
For example, if the input file(Test_data.txt) contains 0 0 0 1 1 1 1 2 the output to the screen is 0 0 0 1 1 1 1 2 5.236 <-Length 

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!