Warm tip: This article is reproduced from stackoverflow.com, please click
complexity-theory graph-theory traveling-salesman brute-force

How I can show the correctness of brute-force TSP algorithm?

发布于 2020-06-27 20:12:11

I'm working on exploring TSP. So I have to prove the correctness of brute-force algorithm on graphs (pickin up the good permutation from all permutations that exists ~ O(n!)). So I'm learning a lot of books and sites, but I can't find how to prove the correctness. Does the prove exists in books and scientists works? If anyone had the same problem before or know how to solve this problem, can you give me advice please?

Questioner
aristari
Viewed
33
Ido 2020-04-17 05:41

the proof for all brute force algorithms are basically the same: let BF be a brute force and X the set of all possible solutions. let us assume our algorithm, BF has returned x in X, than let us assume by contradiction that there exists y in X such that y is a better solution than x. but BF is a brute force algorithm, so he compared x and y, and deduced x is better. contradiction. so x is better than y.