Originally Posted by
kenster421
While I will concede that the case of a Tree is a good reason to employ this, I cannot think of any reason that a Graph should contain a collection of Graphs. If this is the functionality needed, use the Composite Design Pattern. Generally speaking (from a design perspective) an ideologically singular object like Car, should not contain a bunch of Cars within it.
Composite pattern - Wikipedia, the free encyclopedia
Perhaps I'm not writing clearly enough - not a Graph containing a collection of Graphs or a Tree containing a collection of Trees - A Node containing a Collection of Nodes, the Set of all Nodes being the Tree or Graph. In the case of a Graph, often the Nodes contain collections of Edges rather than Nodes, but not always.