Given matrices
and
with positive elements, this paper proposes an algorithm fastRG to sample a sparse matrix
A with low rank expectation
and independent Poisson elements. This allows for quickly sampling from a broad class of stochastic blockmodel graphs (degree-corrected, mixed membership, overlapping) all of which are specific
... [Show full abstract] parameterizations of the generalized random product graph model defined in Section 2.2. The basic idea of fastRG is to first sample the number of edges m and then sample each edge. The key insight is that because of the the low rank expectation, it is easy to sample individual edges. The naive "element-wise" algorithm requires operations to generate the adjacency matrix A. In sparse graphs, where , ignoring log terms, fastRG runs in time O(n). An implementation in fastRG is available on github. A computational experiment in Section 2.4 simulates graphs up to n=10,000,000 nodes with edges. For example, on a graph with n=500,000 and , fastRG runs in less than one second on a 3.5 GHz Intel i5.