  Let $G$ be a finite simple graph with the vertex set $V$ and let $I_G$ be its
edge ideal in the polynomial ring $S=\mathbb{K}[x_V]$. In this paper, we
compute the depth and the Castelnuovo--Mumford regularity of $S/I_G$ when
$G=G_1\circ G_2$ or $G=G_1* G_2$ is a graph obtained from Cohen-Macaulay
bipartite graphs $G_1$, $G_2$ by $\circ$ operation or $*$ operation,
respectively.
