Create ordering of points

Ben Bacarisse ben.usenet at bsb.me.uk
Wed Feb 15 10:39:06 EST 2017


spiess.benjamin at googlemail.com writes:

> I've got a problem which I would really like to solve. 
> I got a cloud of points (in the simplest example its a 2-dimensional
> cloud of points).
> First, I want to set one of the points as the initial (or middle)
> point. Starting from there, the next points with the closest distance
> to the initial points are to be found. Afterwards, the closest points
> to these points are to be written out. These points shall be connected
> like it is depicted in this figure
> http://fs5.directupload.net/images/170215/b835zixm.jpg
>
> With this approach, the "fastest" path from every point to the defined
> initial point are specified by this pattern.

The fastest path will be a direct line -- every point connected to the
root (you are building a tree).  Are you perhaps looking for what is
call the minimum spanning tree?

This is not really a Python question.  Some language Usenet groups and
mailing lists (this is both) don't like general programming questions
and some don't mind.  I'm not sure what comp.lang.python's view is on
these things, but groups like comp.programming and even comp.theory are,
on the surface, better places to ask.  Unfortunately they are full of
cranks. though they can be ignored.

<snip>
-- 
Ben.



More information about the Python-list mailing list