# How to get the shortest connection between two vertices in Geometry Nodes?

Top and bottom of the points:

1. the top and bottom plane points have random position, but equal number.

2. the points are not exactly on the same plane, but is XYZ distributed.

3. the maximum upper limit can be 1000 points. In this example there are only 8 points.

How to get the shortest connection between two points with Geometry Nodes?

Bonus: How do you make sure that the sum of the lengths of the edge connected at the top and bottom is the smallest?

• It's not explicitly stated, but it seems You don't want any point to be a part of more than one edge? Or in other words, you want to create as many edges as half of the points, and you want all points to be used? Commented Oct 22, 2022 at 10:23
• Sorry about that, yes, must one to one connected between two vertices of top and bottom. I researched another answer, but it only works in 1D space, can't apply to 2D or 3D space. blender.stackexchange.com/questions/260218/… Commented Oct 22, 2022 at 10:52
• So, is it posibile to do it in geometry node? Commented Oct 22, 2022 at 11:36