Monomial ideals of graphs with loops