stock span problem Algorithm

Even though the problem is computationally difficult, many heuristics and exact algorithms are known, so that some cases with tens of thousands of city can be solved completely and even problems with millions of city can be estimated within a small fraction of 1%.The TSP has several applications even in its purest formulation, such as planning, logistics, and the manufacture of microchips. Thus, it is possible that the worst-case running time for any algorithm for the TSP increases superpolynomially (but no more than exponentially) with the number of city. 

For many other cases with millions of city, solutions can be found that are guaranteed to be within 2-3 % of an optimal tour. In the 1960s however a new approach was created, that instead of searching optimal solutions, one would produce a solution whose length is provably bounded by a multiple of the optimal length, and in making so make lower boundary for the problem; these may then be used with branch and bound approaches. While this paper make not give an algorithmic approach to TSP problems, the ideas that put within it were indispensable to later make exact solution methods for the TSP, though it would take 15 years to find an algorithmic approach in make these cuts.

stock span problem source code, pseudocode and analysis