  A sparse stochastic block model (SBM) with two communities is defined by the
community probability $\pi_0,\pi_1$, and the connection probability between
communities $a,b\in\{0,1\}$, namely $q_{ab} = \frac{\alpha_{ab}}{n}$. When
$q_{ab}$ is constant in $a,b$, the random graph is simply the
Erd\H{o}s-R\'{e}ny random graph. We evaluate the log partition function of the
Ising model on sparse SBM with two communities.
  As an application, we give consistent parameter estimation of the sparse SBM
with two communities in a special case. More specifically, let $d_0,d_1$ be the
average degree of the two communities, i.e.,
$d_0\overset{def}{=}\pi_0\alpha_{00}+\pi_1\alpha_{01},d_1\overset{def}{=}\pi_0\alpha_{10}+\pi_1\alpha_{11}$.
We focus on the regime $d_0=d_1$ (the regime $d_0\ne d_1$ is trivial). In this
regime, there exists $d,\lambda$ and $r\geq 0$ with $\pi_0=\frac{1}{1+r},
\pi_1=\frac{r}{1+r}$, $\alpha_{00}=d(1+r\lambda), \alpha_{01}=\alpha_{10} =
d(1-\lambda), \alpha_{11} = d(1+\frac{\lambda}{r})$. We give a consistent
estimator of $r$ when $\lambda<0$. The estimator of $\lambda$ given by
\citep{mossel2015reconstruction} is valid in the general situation. We also
provide a random clustering algorithm which does not require knowledge of
parameters and which is positively correlated with the true community label
when $\lambda<0$.
