## Making connections

Here’s something fun I was playing around with today. I generated 100 random points and connected some of them with lines. Can you figure out how I chose which lines to draw?

How about these? (Same points, different lines.)

Or these?

Here are some more. The first three groups in the grid below correspond to the pictures already shown above.

Assistant Professor of Computer Science at Hendrix College. Functional programmer, mathematician, teacher, pianist, follower of Jesus.
This entry was posted in challenges, geometry and tagged , , , . Bookmark the permalink.

### 10 Responses to Making connections

1. joshua n says:

Draw a line to your closest neighbor, 2nd closest neighbor, et c.

2. Devin says:

Hmmm… For the first one, you calculated the nearest neighbor distance, sorted by ascending distance, connected them one at a time in that order until each point was connected to at least one other point.

For the next one, you calculated the 2nd nearest neighbor distance, sorted by ascending distance, etc.

Same for the nth group in the grid (L-to-R, T-to-B).

3. Gabriela Cristian says:

My guess is that in the first picture each dot is connected to the dot closest to it, the second picture is each connected to the second-closest, and so on.

4. Brent says:

Right! The only thing that’s not quite accurate is Devin’s comment “Same for the nth group in the grid (L-to-R, T-to-B).” Look more carefully… =)

This was fun for me since I actually had no very good idea of how it would look before I tried it. It’s interesting that with connecting nearest neighbors you end up with lots of small connected structures. I wonder — what is the expected number of points in one of those connected structures?

• Devin says:

[squint] Perhaps the second row isn’t 5th-closest neighbor? Maybe the 11th closest? In which case the next rows are 21st and 31st? Great fun!

• Brent says:

Something like that. I don’t remember the exact numbers I used. Note, however, that the final one corresponds to the 100th closest (or maybe 95th, something close to that anyway)—all the edges go diagonally to the furthest corner.

5. td says:

In effects for movies, these connection tricks are used all the time. For instance in particle simulations points will move around based on some dynamics and then turned into a volume by connecting n-closest with segments. It’s sometimes easier to design the effect and visualize the end result than moving around volumes. plenty of examples here: http://www.imdb.com/video/imdb/vi3445005593/
not a great movie though.

• Brent says:

Cool, didn’t know that!

6. Shaun says: