I've been breeding my Vault Dwellers together pretty indiscriminately, and as such I really have no idea what their family trees look like. I don't have much to go on other than their last name, which is a imperfect metric at best. Not infrequently I'll put two dwellers into living quarters only to find out that they're considered related. How does the game determine whether or not two dwellers are related? 

This question is largely academic, since I haven't been keeping records of who had reproduced with who, but I'm still curious.