The composite design pattern is used to represent hierarchies and networks.
The simplest example is a tree data structure (such as a binary tree or 2-3 tree). In this case parent nodes are composites while leaf nodes are primitives:
Here's a sample implementation:
Of course nothing in this pattern prevents a child of parent p from being p's grandparent. Thus, arbitrarily complex networks or graphs can be represented by this pattern.