0

I am trying to find the solution of the traveling salesman problem using various techniques. I have tested my code for some sample data. The optimal solution is known. Now I want to find the approximation ratio of my algorithm. how will I do that? Suppose, my code gives the cost of C(x) and the optimal cost is C(y). Then will the value of C(x)/C(y) be the approximation ratio or there is other way to find this out?

AAA
  • 87
  • 3
  • 9
  • 1
    The term **approximation-ratio** is usually used within **approximation-algorithms**, which are proven to always produce a solution within these bounds. I'm pretty sure, your algorithm is heuristics-based and don't offer (a worthwile) bound. Also: this approximation-ratio is never analyzed empirically. It's always proven mathematically (given the assumptions about the problem; caring about **all instances**; therefore no analysis with actual runs). I'm not sure if you want to analyze this (because it's hard) or if you just want to calculate something like the optimality-gap for your instances. – sascha Sep 09 '16 at 13:01
  • Given the difinition above: a crude and bad approximation of the approximation-ratio would be: ```1.0 / min(C(x_i)/C(y_i)) for many runs i```. The use of ```min``` cares about the general idea of the approximation-ratio: ```no matter which instance; my algorithm will not be relatively worse than a factor x``` (it's *not* an average!) – sascha Sep 09 '16 at 13:03
  • 1
    You are using the technical term *approximation ratio* which, as @sascha points out, has a specific meaning. But I think you are just asking how to evaluate the quality of a given solution from your heuristic -- sometimes called the *cost ratio* or other things. In that case, yes, C(x)/C(y) is an appropriate measure, as is C(x)/C(y) - 1 (the *optimality error*). – LarrySnyder610 Sep 10 '16 at 12:09

0 Answers0