  In 2007 we introduced a general model of sparse random graphs with
independence between the edges. The aim of this paper is to present an
extension of this model in which the edges are far from independent, and to
prove several results about this extension. The basic idea is to construct the
random graph by adding not only edges but also other small graphs. In other
words, we first construct an inhomogeneous random hypergraph with independent
hyperedges, and then replace each hyperedge by a (perhaps complete) graph.
Although flexible enough to produce graphs with significant dependence between
edges, this model is nonetheless mathematically tractable. Indeed, we find the
critical point where a giant component emerges in full generality, in terms of
the norm of a certain integral operator, and relate the size of the giant
component to the survival probability of a certain (non-Poisson) multi-type
branching process. While our main focus is the phase transition, we also study
the degree distribution and the numbers of small subgraphs. We illustrate the
model with a simple special case that produces graphs with power-law degree
sequences with a wide range of degree exponents and clustering coefficients.
