We define a simple graph as compact if it lacks even cycles and satisfies the odd-cycle condition. Our focus is on classifying all compact graphs and examining the characteristics of their edge rings. Let G be a compact graph and K[G] be its edge ring. Specifically, we demonstrate that the Cohen-Macaulay type and the projective dimension of K[G] are both equal to the number of induced cycles of G minus one, and that the regularity of K[G] is equal to the matching number of G0. Here, G0 is obtained from G by removing the vertices of degree one successively, resulting in a graph where every vertex has a degree greater than 1.