Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Materials Science and Engineering

Authors: Donald R. Askeland, Wendelin J. Wright

3rd edition

978-1111576868, 1111576866, 978-1285677620, 1285677625, 978-1111576851

More Books

Students also viewed these Mechanical Engineering questions

Question

How should Bernice manage her career-related stress?

Answered: 1 week ago