Check distance combination item in array / list

Hello, I really thanks to someone who can answer my question. Before, I’m sorry for my bad english cause my native languange is not english.

I have a school project. Until now, I still try to know how to find the group gameobject in array / list that have the closest distance. This is the layout of my project.

If we look that picture, we know that the group of two object inside the line is not group two object that have the closest distance. So, how to find that there’s not group of two object that have the closest distance ? Anyone can help me please ?

I think about combination (like in mathematics), but I don’t know how to impelementation that in C# unity.

@samyn26
Hi, I am not sure if I completely understand your question but maybe this helps.