ARTICLE AD BOX
My question is mainly regarding that: I don't even know where to start when it comes to looking up solutions to an issue.
I'm aware I need something like an algorithm, but I'm unaware of any and where to find any definitive place to start looking in a helpful direction. If you know about the Pokemon games, this will make the most sense to you.
I'm trying to make a tool that can find the shortest connection between egg groups. I think the best way I can explain it to other people is that my friend referred to it as a "traveling salesman" puzzle. These groups can be "broken into" by finding individuals who straddle 2 different groups so can make a "path" through them.

Some creatures can breed with others, and the main groups I came up with while I thought I was dealing with a BFS, and I thought I needed a more definitive "tree" to travel. This was the most basic version of what I ended up with, and if this was all, I'm sure BFS would have been a great fit (since there's a definitive endpoint.)
But it's not that simple. More of the complex connections look like this.

And, this isn't all of the connections, by far. I just couldn't make any more arrows/was getting mixed up. Each group loops into another one, somehow.
So, basically, it's a knotted mess with no actual definitive endpoint and some things overlapping with other "branches."
The only thing I know is that this is definitely something relevant to computer science, which is completely out of my wheelhouse (I'm trying to teach myself at my own pace.)
I'm also trying to accomplish this via javascript, even though that's not exactly the ideal language for my scenario. I'm using Google apps sheets script to create this. I managed to use one algorithm in one sheet (levenshtein), so I'm hoping it's still possible in this specific situation.
Even a direction as to what to look at helps. I can't figure out what to even type into google, particularly since it's not talking about actual, physical distance.
