  We develop random graph models where graphs are generated by connecting not
only pairs of vertices by edges but also larger subsets of vertices by copies
of small atomic subgraphs of arbitrary topology. This allows the for the
generation of graphs with extensive numbers of triangles and other network
motifs commonly observed in many real world networks. More specifically we
focus on maximum entropy ensembles under constraints placed on the counts and
distributions of atomic subgraphs and derive general expressions for the
entropy of such models. We also present a procedure for combining distributions
of multiple atomic subgraphs that enables the construction of models with fewer
parameters. Expanding the model to include atoms with edge and vertex labels we
obtain a general class of models that can be parametrized in terms of basic
building blocks and their distributions that includes many widely used models
as special cases. These models include random graphs with arbitrary
distributions of subgraphs, random hypergraphs, bipartite models, stochastic
block models, models of multilayer networks and their degree corrected and
directed versions. We show that the entropy for all these models can be derived
from a single expression that is characterized by the symmetry groups of atomic
subgraphs.
