Question: Purpose REII 211 2023: Coding_challenge 1 This assignment aims to create a nearest-neighbour heuristic, and optimal search for the robot tour optimisation problem (a.k.a

Purpose REII 211 2023: Coding_challenge 1 This assignment aims to create a

Purpose REII 211 2023: Coding_challenge 1 This assignment aims to create a nearest-neighbour heuristic, and optimal search for the robot tour optimisation problem (a.k.a Travelling Salesman Problem) discussed in section 1.1, Chapter 1 of Skiena. Task: 1. Create a program that accepts five cartesian (x,y) coordinates: (x1,y1}.{x2,y2},{x3,y3},{x4,y4},{x5,y5}. These coordinates can be "hardcoded" in your main function or typed in from the command prompt. The program should print the five used coordinates to the screen and their number, i.e., pair 1: (x1,y1}, pair 2: {x2,y2}. The route followed using the nearest-neighbour heuristic should be shown in the output and the route's total distance. To simplify your the math in your implementation, work with integers and round numbers to the nearest integer. 2. Extend the program's functionality above to include the optimal (brute force) answer for the robot tour problem. Show the optimal route followed, together with the route's total distance. 3. Compare the answers that you get using the two algorithms. Comment on what you observe.

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 Mechanical Engineering Questions!