| Start |
|---|
| Brute Force Algorithm A path through every vertex exactly once is the same as ordering the vertex in some way. Thus, to calculate the minimum cost of travelling through every vertex exactly once, we can brute force every single one of the Psuedocode Time Complexity There are |
| Dynamic Programming Algorithm Notice that if we consider the path (in order): and the path The cost of going from vertex Let Since Thus we can have the following algorithm (C++ implementation): This line may be a little confusing, so lets go through it slowly: Here, Thus, this line is to update the value of Time Complexity The function RemarksThe Travelling Salesman Problem is the problem of finding the minimum cost of travelling through There are 2 types of algorithms to solve this problem: Exact Algorithms and Approximation Algorithms Exact Algorithms
Approximation Algorithms To be added |
Read Article
https://develop.horje.com/learn/1434/reference