  Let $S$ be a semigroup with $0$ and $R$ be a ring with $1$. We extend the
definition of the zero-divisor graphs of commutative semigroups to not
necessarily commutative semigroups. We define an annihilating-ideal graph of a
ring as a special type of zero-divisor graph of a semigroup. We introduce two
ways to define the zero-divisor graphs of semigroups. The first definition
gives a directed graph ${\Gamma}(S)$, and the other definition yields an
undirected graph $\overline{{\Gamma}}(S)$. It is shown that $\Gamma(S)$ is not
necessarily connected, but $\overline{{\Gamma}}(S)$ is always connected and
${\rm diam}(\overline{\Gamma}(S))\leq 3$. For a ring $R$ define a directed
graph $\Bbb{APOG}(R)$ to be equal to $\Gamma(\Bbb{IPO}(R))$, where
$\Bbb{IPO}(R)$ is a semigroup consisting of all products of two one-sided
ideals of $R$, and define an undirected graph $\overline{\Bbb{APOG}}(R)$ to be
equal to $\overline{\Gamma}(\Bbb{IPO}(R))$. We show that $R$ is an Artinian
(resp., Noetherian) ring if and only if $\Bbb{APOG}(R)$ has DCC (resp., ACC) on
some special subset of its vertices. Also, It is shown that
$\overline{\Bbb{APOG}}(R)$ is a complete graph if and only if either
$(D(R))^{2}=0$, $R$ is a direct product of two division rings, or $R$ is a
local ring with maximal ideal $\mathfrak{m}$ such that
$\Bbb{IPO}(R)=\{0,\mathfrak{m},\mathfrak{m}^{2}, R\}$. Finally, we investigate
the diameter and the girth of square matrix rings over commutative rings
$M_{n\times n}(R)$ where $n\geq 2$.
