A salesman visits 4 locations, A, B, C, and D. Distances between A and B; A and D; A and D; B and C; B and D; and C and D are given by 2, 3, 4, 3, 4, 2 respectively. Use an exhaustive search approach to find the best travel route for the salesman. Show all possible routes and their lengths and find the smallest. What is the efficiency of this algorithm?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

A salesman visits 4 locations, A, B, C, and D. Distances between A and B; A and D; A and D; B and C; B and D; and C and D are given by 2, 3, 4, 3, 4, 2 respectively.

  1. Use an exhaustive search approach to find the best travel route for the salesman. Show all possible routes and their lengths and find the smallest.
  2. What is the efficiency of this algorithm?
Expert Solution
Step 1

Exhaustive Search

To solve combinatorial issues, a brute-force method is used (permutations, combinations). In this method, each element in the problem is generated, and only the elements that satisfy all the constraints are chosen as the final element. This strategy is not simple; to find all combinational items, we require a generative method.

Traveling Salesman Problem

Even if you don't know what this issue is, you've probably heard of it because it is so well-known. What should be the shortest tour that a salesman can accomplish by stopping in each city just once?

This issue can be modelled using a weighted graph. Cities are represented by vertices, and distances are represented by edge weights. Finding the shortest path in a Hamiltonian circuit then becomes the issue. A cycle that goes through every vertex of the graph exactly once is known as a Hamiltonian circuit.

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Eight puzzle problem
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education