I want to know that which data structure suits best for storing the family tree for a person, there are spousal, child and parental relationships. Also i want to know that if one person is has blood relationship with other.
It would be good i some data structure from c++ STL can be found.
Just ideas are required.
Is it homework?
Even if it’s called “Tree”, It’s a bad structure : imagine two brother who marry two sisters.
A general graph structure would be the best (a tree being a specific form of a graph). The edge would carry the relationship. Then you can run a path finding algorithm (like good old dijkstra) only on edges which represent blood relationship.
And boost::graph is a very good library.