  Let $G$ be a finite simple graph with edge ideal $I(G)$. Let $J(G)$ denote
the Alexander dual of $I(G)$. We show that a description of all induced cycles
of odd length in $G$ is encoded in the associated primes of $J(G)^2$. This
result forms the basis for a method to detect odd induced cycles of a graph via
ideal operations, e.g., intersections, products and colon operations. Moreover,
we get a simple algebraic criterion for determining whether a graph is perfect.
We also show how to determine the existence of odd holes in a graph from the
value of the arithmetic degree of $J(G)^2$.
