I'm trying to represent and traverse graphs in order to show and control family relationships. I've been able to build the edges to make the following graph (How to draw a tree more beautifully in networkx plus countless others have gotten me this far - my red numbers of course)
So I understand this to be a Directed Graph with Parent relationships shown. I want to be able to get some more information using networkx but I haven't been able to work out how to approach it. I'd even take some good doco/tutorials if people have them but I'm trying to solve the following:
I've been able to identify the children who are also parents, can I split these into seperate graphs? e.g. 2,3,6,7,8,9,10,11,12 are one "family", 5,9,15 are another "family", 1,5 is also a family
Can I color or otherwise show the generations. I see 3 generations here (1,2,3 and 4-12 and 13-15) I believe I can use a topological sort to find these orders, however when I do I get 4 nodes, then 8 then 3 instead of 3,9,3