Question
4. Consider the travelling salesperson problem with 5 cities: A, B, C, D, E. You start in A and must visit each city exactly once
4. Consider the travelling salesperson problem with 5 cities: A, B, C, D, E. You start in A and must visit each city exactly once before flying (directly) back to A. The cost of a one-way flight between pairs of cities (in hundreds of dollars) is given below (note: the cost to fly in either direction is the same for the purposes of this question).
AB(3), AC(2), AD(12), AE(7), BC(4), BD(9), BE(8), CD(7), CE(6), DE(6)
i. Using the greedy algorithm (at each step, taking the cheapest available flight to an unvisited city), what is the sequence of cities visited and what is the total cost of all flights taken?
ii. Is the solution from part i optimal? If it is, explain how you know it is. If not, find a solution that is optimal.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started