When creating an app like a family tree, I want to prevent the user from creating relationships that will create a cycle. Is it possible to tell if a transaction will create a cycle before committing?
li3zhang, welcome to the community! Love the question as I love graph theory
Given a family tree is a directed graph (i.e., a father of a son is not a son to a father for the same two nodes), getting a cycle will be impossible. Certainly, someone's cousin can be another persons brother and this can result in a "cycle" if you ignore direction and relationship type. But I would contend that finding cycles by ignoring relationship type and direction would be very useful and desired in terms of insights in your tree - especially before the royal wedding
Am I missing something or is that helpful?