Hi Wendi,
I'm a little reluctant to get too specific, for two reasons:
1. There's a little bit of "secret sauce" here. "Trade secret" is probably too strong a connotation, but we have created some proprietary technology for path searches that we don't necessarily want to publish publicly;
2. The algorithm has been refined several times, and may change again. So whatever I say now may be different in a month or six months.
That said, here's the general idea: if a profile is relatively close to you, we keep that around at all times and you will see the relationship in real time, every time you visit the profile. The range for this is something akin to your Family Group settings. Otherwise, we check whether we have stored a path from a previous search; if it's less than a week old and still valid, we give you that path and do nothing more. If it's more than a week old, we show it with a "refresh" icon (two circular arrows, similar to a recycle logo) at then end of the description string. If you click the refresh icon or if nothing was previously stored and you click the "How Are You Related?" button, we try several ways to find a path starting with blood relatives and failing that, moving on to inlaw relationships. In each case we can only look so far before the server would exhaust its resources crawling the tree, so it may fail to find a path if someone is connected to you but very distant, especially through many marriages.
Sorry it's a little vague but I hope that helps!
Mike at Geni