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
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. 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 7000 points and that the input file will be named Test.txt. The test points will need to be read from that file(As in ifstream file("Test.txt"). For example, if the input file(Test.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
If any clarification is needed, please ask.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
