This is always going to be recursive.
What you probably meant to do is pass the depth variable to your method. Right now, in your method you do this:
int depth = 0;
if (++depth < 10) { }
So that if statement is always going to be true. What you should do is pass the depth parameter do your recursive method, as a ref parameter. Like this:
protected void BottomSearch(String AncestorFamilyID, ArrayList RelationPath, ref int depth)
{
if (++depth < 10) {}
}
When depth is 10, it'll not enter the if statement, and no longer will call this method recursively.