Back to courses
Mathematics for Everyone beginner

The travelling salesman problem

Duration0 hours
Modules7
ForGeneral public, lifelong learners
Video1-2min
Get started — free →

Course outline

Module 1 Module 1: Introduction to the Traveling Salesman Problem

Introduction to the Traveling Salesman Problem

Introduction

Core content I

Core content II

Core content III

Summary

Further learning

Knowledge check

Q1. What is the primary objective of the Traveling Salesman Problem?
  • A. To find the shortest possible route that visits every city exactly once and returns to the origin city ✓
  • B. To find the longest possible route that visits every city exactly once and returns to the origin city
  • C. To find the fastest possible route that visits every city exactly once and returns to the origin city
  • D. To find the most expensive possible route that visits every city exactly once and returns to the origin city

Why: The primary objective of the Traveling Salesman Problem is to find the shortest possible route that visits every city exactly once and returns to the origin city.

Q2. Which of the following is a common application of the Traveling Salesman Problem?
  • A. Route planning for delivery services ✓
  • B. Solving quadratic equations
  • C. Designing computer networks
  • D. Creating music compositions

Why: A common application of the Traveling Salesman Problem is route planning for delivery services.

Q3. What type of problem is the Traveling Salesman Problem classified as?
  • A. A linear programming problem
  • B. An integer programming problem
  • C. A combinatorial optimization problem ✓
  • D. A differential equation problem

Why: The Traveling Salesman Problem is classified as a combinatorial optimization problem.

Q4. What is the time complexity of the brute-force approach to solve the Traveling Salesman Problem?
  • A. O(n)
  • B. O(n log n)
  • C. O(n!) ✓
  • D. O(n^2)

Why: The time complexity of the brute-force approach to solve the Traveling Salesman Problem is O(n!).

Q5. Which of the following is a heuristic method used to solve the Traveling Salesman Problem?
  • A. Linear programming
  • B. Dynamic programming
  • C. Greedy algorithm ✓
  • D. Quadratic programming

Why: A heuristic method used to solve the Traveling Salesman Problem is the greedy algorithm.

Module 2 Module 2: Mathematical Formulation and Models

Mathematical Formulation and Models

Introduction

Core content I

Core content II

Core content III

Summary

Further learning

Knowledge check

Q1. What is the objective of the Travelling Salesman Problem (TSP)?
  • A. To find the shortest possible route that visits each city exactly once and returns to the starting city ✓
  • B. To find the longest possible route that visits each city exactly once and returns to the starting city
  • C. To find the route that visits the maximum number of cities
  • D. To find the route that minimizes the number of cities visited

Why: The objective of TSP is to find the shortest possible route that visits each city exactly once and returns to the starting city.

Q2. In the TSP, what is typically represented as nodes in a graph?
  • A. Cities or locations ✓
  • B. Routes or paths
  • C. Distances between cities
  • D. Time taken to travel between cities

Why: In the TSP, nodes in a graph typically represent cities or locations.

Q3. Which of the following is a common application of the TSP?
  • A. Optimizing delivery routes for a courier company ✓
  • B. Designing computer networks
  • C. Creating music compositions
  • D. Calculating the area of a triangle

Why: A common application of TSP is optimizing delivery routes for a courier company.

Q4. What type of problem is the TSP classified as?
  • A. A linear programming problem
  • B. An integer programming problem ✓
  • C. A quadratic programming problem
  • D. A convex optimization problem

Why: The TSP is classified as an integer programming problem because it involves finding integer solutions for visiting cities.

Q5. In the TSP, what does the edge weight between two nodes typically represent?
  • A. The number of cities visited
  • B. The distance or cost between two cities ✓
  • C. The time taken to visit a city
  • D. The number of routes available between two cities

Why: In the TSP, the edge weight between two nodes typically represents the distance or cost between two cities.

Module 3 Module 3: Exact Algorithms for TSP

Exact Algorithms for TSP

Introduction

Core content I

Core content II

Core content III

Summary

Further learning

Module 4 Module 4: Heuristics and Approximation Methods

Heuristics and Approximation Methods

Introduction

Core content I

Core content II

Core content III

Summary

Further learning

Knowledge check

Q1. What is the primary goal of a heuristic method in the context of the travelling salesman problem?
  • A. To find the exact optimal solution in polynomial time
  • B. To find a good approximate solution in a reasonable amount of time ✓
  • C. To guarantee the shortest possible route every time
  • D. To eliminate the need for any computational processing

Why: Heuristic methods are used when finding the exact optimal solution is computationally expensive or infeasible, so they aim to find a good approximate solution efficiently.

Q2. Which of the following is a common example of a constructive heuristic for the TSP?
  • A. Simulated Annealing
  • B. Nearest Neighbour Algorithm ✓
  • C. Genetic Algorithm
  • D. Tabu Search

Why: The Nearest Neighbour Algorithm is a constructive heuristic that builds a tour by connecting the nearest unvisited city at each step.

Q3. What is the main disadvantage of using a greedy heuristic like the Nearest Neighbour Algorithm?
  • A. It requires too much memory
  • B. It may produce suboptimal solutions ✓
  • C. It is too slow for large problems
  • D. It is not applicable to symmetric TSP instances

Why: Greedy heuristics can lead to locally optimal solutions that are not globally optimal, resulting in suboptimal tours.

Q4. Which of the following is an example of an improvement heuristic for the TSP?
  • A. Randomised Search
  • B. 2-Opt Algorithm ✓
  • C. Ant Colony Optimization
  • D. Greedy Algorithm

Why: The 2-Opt Algorithm is an improvement heuristic that iteratively improves an existing tour by swapping pairs of edges.

Q5. What is the main purpose of using approximation algorithms in the TSP?
  • A. To find the exact solution in all cases
  • B. To provide a solution with a guaranteed performance bound ✓
  • C. To reduce the problem to a smaller size
  • D. To make the problem easier to visualize

Why: Approximation algorithms provide a solution with a guaranteed performance bound relative to the optimal solution, making them useful for large-scale problems.

Module 5 Module 5: Applications of TSP in Real Life

Applications of TSP in Real Life

Introduction

Core content I

Core content II

Core content III

Summary

Further learning

Knowledge check

Q1. What is the main objective of the Travelling Salesman Problem?
  • A. To find the shortest possible route that visits each city exactly once and returns to the origin city ✓
  • B. To find the longest possible route that visits each city exactly once and returns to the origin city
  • C. To find the fastest way to deliver packages to multiple cities
  • D. To find the cheapest way to travel between two cities

Why: The main objective of the TSP is to find the shortest possible route that visits each city exactly once and returns to the starting point.

Q2. Which of the following is NOT a real-life application of the TSP?
  • A. Route planning for delivery services
  • B. Scheduling jobs on a machine ✓
  • C. Designing efficient circuits in electronics
  • D. Planning a tourist trip visiting multiple cities

Why: Scheduling jobs on a machine is not a direct application of the TSP, although it may be related to other optimization problems.

Q3. In which field is the TSP commonly used to optimize the layout of components on a circuit board?
  • A. Computer science
  • B. Civil engineering
  • C. Electronics ✓
  • D. Astronomy

Why: In electronics, the TSP is used to optimize the layout of components on a circuit board to minimize the length of connections.

Q4. Which of the following is a common approach to solving the TSP for large numbers of cities?
  • A. Brute force algorithm
  • B. Greedy algorithm
  • C. Heuristic methods like genetic algorithms or simulated annealing ✓
  • D. Manual calculation

Why: For large numbers of cities, heuristic methods like genetic algorithms or simulated annealing are commonly used to find near-optimal solutions.

Q5. What does the TSP assume about the salesman's travel between cities?
  • A. The salesman can only travel to one city at a time
  • B. The salesman can teleport between cities
  • C. The salesman can visit cities in any order without restrictions
  • D. The salesman must return to the starting city after visiting all cities ✓

Why: The TSP assumes that the salesman must return to the starting city after visiting all cities, making it a closed-loop problem.

Module 6 Module 6: Computational Complexity and P vs NP

Computational Complexity and P vs NP

Introduction

Core content I

Core content II

Core content III

Summary

Further learning

Knowledge check

Q1. What does P stand for in the context of computational complexity?
  • A. Polynomial time ✓
  • B. Polynomial problem
  • C. Practical problem
  • D. Perfect problem

Why: P stands for Polynomial time, referring to problems that can be solved in polynomial time by a deterministic Turing machine.

Q2. What does NP stand for in the context of computational complexity?
  • A. Non-deterministic Polynomial time ✓
  • B. Non-practical Polynomial time
  • C. New Polynomial time
  • D. Non-Perfect Polynomial time

Why: NP stands for Non-deterministic Polynomial time, referring to problems where a solution can be verified in polynomial time by a deterministic Turing machine.

Q3. Which of the following is an example of an NP-Complete problem?
  • A. Shortest path problem
  • B. Travelling Salesman Problem ✓
  • C. Binary search
  • D. Sorting problem

Why: The Travelling Salesman Problem is a well-known example of an NP-Complete problem.

Q4. What is the significance of the P vs NP problem?
  • A. It determines whether all problems can be solved efficiently ✓
  • B. It determines whether all problems can be solved in linear time
  • C. It determines whether all problems can be solved in logarithmic time
  • D. It determines whether all problems can be solved in exponential time

Why: The P vs NP problem is significant because it determines whether all problems that can be verified efficiently (NP) can also be solved efficiently (P).

Q5. Which of the following is true about NP-Hard problems?
  • A. They are a subset of NP problems
  • B. They are not necessarily in NP ✓
  • C. They can be solved in polynomial time
  • D. They are always solvable in exponential time

Why: NP-Hard problems are not necessarily in NP, but they are at least as hard as the hardest problems in NP.

Module 7 Module 7: Case Studies and Practical Implementation

Case Studies and Practical Implementation

Introduction

Core content I

Core content II

Core content III

Summary

Further learning

Knowledge check

Q1. What is the primary objective of the travelling salesman problem?
  • A. To find the shortest possible route that visits each city exactly once and returns to the origin city ✓
  • B. To find the longest possible route that visits each city exactly once and returns to the origin city
  • C. To find the route with the least number of cities visited
  • D. To find the route with the highest travel cost

Why: The primary objective of the TSP is to find the shortest possible route that visits each city exactly once and returns to the starting point.

Q2. Which of the following is a common application of the travelling salesman problem?
  • A. Route planning for delivery services ✓
  • B. Solving quadratic equations
  • C. Designing computer networks
  • D. Creating music compositions

Why: The TSP is commonly applied in route planning for delivery services, where minimizing travel distance is crucial.

Q3. Which algorithm is often used for solving small instances of the TSP?
  • A. Genetic Algorithm
  • B. Brute Force Algorithm ✓
  • C. Simulated Annealing
  • D. Ant Colony Optimization

Why: The Brute Force Algorithm is often used for solving small instances of the TSP because it checks all possible permutations.

Q4. What is a key limitation of the Brute Force Algorithm when solving the TSP?
  • A. It is too slow for large instances of the problem ✓
  • B. It requires too much memory
  • C. It is not accurate enough
  • D. It is difficult to implement

Why: The Brute Force Algorithm is too slow for large instances of the TSP because the number of permutations grows factorially with the number of cities.

Q5. Which of the following is a heuristic method used to solve the TSP?
  • A. Dynamic Programming
  • B. Greedy Algorithm ✓
  • C. Linear Programming
  • D. Binary Search

Why: The Greedy Algorithm is a heuristic method used to solve the TSP by making locally optimal choices at each step.

Stay in the loop on this course.

We’ll email you when new modules or related material drops. No spam.

Built with Fragment Language. Sovereign architecture — no third-party trackers.
FragRun.mfgAFImemoryFGOwnership: B-Systems.ee