The notion of a random graph is formally defined. It deals with both the probabilistic and the structural aspects of relational data. By interpreting an ensemble of attributed graphs as the outcomes of a random graph, we can use its lower order distribution to characterize the ensemble. To reflect the variability of a random graph, Shannon's entropy measure is used. To synthesize an ensemble of attributed graphs into the distribution of a random graph (or a set of distributions), we propose a distance measure between random graphs based on the minimum change of entropy before and after their merging. When the ensemble contains more than one class of pattern graphs, the synthesis process yields distributions corresponding to various classes. This process corresponds to unsupervised learning in pattern classification. Using the maximum likelihood rule and the probability computed for the pattern graph, based on its matching with the random graph distributions of different classes, we can classify the pattern graph to a class.