  A method for compression of large graphs and non-negative matrices to a block
structure is proposed. Szemer\'edi's regularity lemma is used as heuristic
motivation of the significance of stochastic block models. Another ingredient
of the method is Rissanen's minimum description length principle (MDL). We
propose practical algorithms and provide theoretical results on the accuracy of
the method.
