On Wed, 2010-07-07 at 12:11 +0300, aleksas.domarkas at post.skynet.lt
wrote:
> This is only example. Other example:
> I ned
> [[7,1],[10,9],[5,7],[4,2],[6,8],[1,6],[9,4],[3,5],[8,10],[2,3]]
> transform to
> [[1,6],[6,8],[8,10],[10,9],[9,4],[4,2],[2,3],[3,5],[5,7],[7,1]]
>
> This lists are solutions of Hamiltonian Cycle problem
> or Travelling Salesman Problem
> see
> http://www.math.jmu.edu/~lucassk/Papers/determinant.pdf
Then, there is no simple function f that acting on a single point will
tell you in which place it should be placed by the sort function. It is
an optimization problem and you need to look at all the points, not just
a single one, in order to get the answer. You would have to implement
one of the known algorithms for that problem, such as the one described
in the PDF document you refer.
Regards,
Jaime