This is a common problem in graph data structures.

Either you store a tree of references or you use an adjacency matrix.

Reply via email to