Good Enough approximation algorithms Ā· ALG 19.6

Some problems are too hard to solve exactly, so we settle for an α-approximation: a solution provably within a factor α of the optimum. Play against two approximation algorithms from ALG 19.6. Then see, on your own instance, why their guarantees hold. Each round gives up to 100 points: 100 Ɨ (how close you got to the optimum).

Cities are points in the plane and ā„“(x,y) is their distance, so the triangle inequality holds. Click the cities to plan a Hamiltonian cycle that starts and ends at the yellow home city a. The algorithm walks around a minimum spanning tree. Can you beat it? Can you hit the optimum?

your tour 0
round 1/5
score 0
best 5-round score –
The algorithm (ALG 19.6): find a minimum spanning tree, root it at a, traverse it by depth-first search. That walk uses every tree edge twice. Then skip every vertex visited before and jump straight to the next unvisited one.
Finish your tour to see the algorithm and the optimum on this map.
Also in ALG 19.6: with a somewhat more complicated trick, metric TSP can be 1.5-approximated. Without the triangle inequality, a polynomial t-approximation for any t ≄ 1 would give P = NP (give the edges of a graph length 1 and all non-edges a huge length c). Knapsack, on the other hand, has an FPTAS: ApproxKnapsack runs in time O(n3/ε).
← ADS2 Arcade