A caterpillar is a tree that reduces to a path graph when pruning
all leaf nodes (p2=0).
A lobster is a tree that reduces to a caterpillar when pruning all
leaf nodes.
Parameters:
n: the expected number of nodes in the backbone
p1: probability of adding an edge to the backbone
p2: probability of adding an edge one level beyond backbone
seed: seed for random number generator (default=None)