Line network, possible to set hirachy of points?

Hello Guys and Girls!

I am quite new to Grashopper and have a slight problem with a network of lines. I’ve been searching though the forum for the last couple of hours but could not find a solution and would be very thankful if someone could help me out.

For a parametric city planning project I have connected plenty of points and afterwards bundled these trough edge bundling.

Not to my problem: I want to bring a hierarchy into to the points. I want to do that by limiting the max number of connections to some groups of points.

For example, I have three groups (supermarket, doctor, school) with each 10 points. Now I want that all connect to each other, but the supermarket-points should connect to all other points, while the school-points only should have 5 connections each.

I tried working with the proximity 2D tool, there I could set the max number of connections, but then only that the input group of Points were connected. I also had a look at the Heteropter tool, without success.

I would be very pleased, if someone cloud help me with an idea or tip!!! :heart_eyes:

Best regards
Chris

this uses the Closest Points component:
→ each supermarket point (black) connected (white lines) with all the non-supermarket points
→ each school point (red) connected with the 5 closest non-school points (highlited in green otherwise some lines will not be visible)


Line network maybe.gh (16.0 KB)

the Closest Points component is kind of useless for the first case of supermarkets connected with everything else, but it gives you the index of closest points and distance info that could be useful

1 Like

Hey inno

Thank you very much, that was the solution! The “Closest Points” Component was the one needed. Again learned something :slight_smile:

have a great weekend!

1 Like